---
Product: Aspose.Slides
Platform: java
Page Type: reference
Canonical URL: https://reference.aspose.org/slides/java/rowcollection
---

# RowCollection

## Overview

`RowCollection` is a class in Aspose.Slides FOSS for Java.
Inherits from: `IRowCollection`, `Iterable<IRow>`.

Represents a collection of rows in a table.

This class declares 13 methods for RowCollection objects in Java programs.
Available methods include: `RowCollection`, `addClone`, `asICollection`, `asIEnumerable`, `get`, `initInternal`, `insertClone`, `iterator`, `rebuild`, `removeAt`, `size`.
Public members are accessible to any Java application after installing the Aspose.Slides FOSS for Java package.

## Methods

| Signature | Description |
|-----------|-------------|
| `RowCollection()` | Creates an empty RowCollection with no XML backing. |
| `RowCollection(rows: List<IRow>)` | Creates a RowCollection with the given initial rows (no XML backing). |
| `RowCollection(tblElement: Element, saveCallback: Runnable)` | Creates a new RowCollection backed by an XML {@code } element. |
| `initInternal(tblElement: Element, saveCallback: Runnable)` → `RowCollection` | Initializes this collection with the given XML element and save callback. |
| `rebuild()` | Rebuilds the row list from the XML {@code } child elements. |
| `get(index: int)` → `IRow` | Returns the IRow at the specified index |
| `size()` → `int` | Calls size on this RowCollection instance. |
| `addClone(templ: IRow, withAttachedRows: boolean)` → `IRow[]` | Creates clones of a template row (optionally with attached rows) and returns them |
| `insertClone(index: int, templ: IRow, withAttachedRows: boolean)` → `IRow[]` | Inserts cloned rows at the given index and returns the new rows |
| `removeAt(firstRowIndex: int, withAttachedRows: boolean)` | Removes rows starting at the given index, optionally also removing attached rows |
| `asICollection()` → `List<IRow>` | Returns the rows as a List<IRow> |
| `asIEnumerable()` → `Iterable<IRow>` | Calls asIEnumerable on this RowCollection instance. |
| `iterator()` → `Iterator<IRow>` | Returns an iterator over the IRow elements |

## See Also

- [Aspose.Slides — Enterprise API Reference](https://reference.aspose.com/slides/)