java.lang.Object
com.aspose.cells.RowCollection
- All Implemented Interfaces:
- java.lang.Iterable
public class RowCollection
- extends java.lang.Object
Collects the objects that represent the individual rows in a worksheet.
Example:
//Instantiating a Workbook object
Workbook workbook = new Workbook();
//Obtaining the reference of the first worksheet
Worksheet worksheet = workbook.getWorksheets().get(0);
//Get first row
Row row = worksheet.getCells().getRows().get(0);
- See Also:
- Row
|
Property Getters/Setters Summary |
int | getCount() | |
|
Gets the number of rows in this collection.
|
Row | get(int) | |
|
Gets a object by given row index. The Row object of given row index will be instantiated if it does not exist before.
|
|
Method Summary |
void | clear() | |
|
Clear all rows and cells.
|
Row | getRowByIndex(int index) | |
|
Gets the row object by the position in the list.
|
java.util.Iterator | iterator() | |
|
Gets an enumerator that iterates through this collection
|
void | removeAt(int index) | |
|
Remove the row at the specified index
|
|
Property Getters/Setters Detail |
getCount | |
public int getCount()
|
-
Gets the number of rows in this collection.
get | |
public Row get(int rowIndex)
|
-
Gets a object by given row index. The Row object of given row index will be instantiated if it does not exist before.
- See Also:
- Row
iterator | |
public java.util.Iterator iterator() |
-
Gets an enumerator that iterates through this collection
- Returns:
- enumerator
Example:
Workbook workbook = new Workbook("template.xlsx");
Cells cells = workbook.getWorksheets().get(0).getCells();
Iterator en = cells.getRows().iterator();
while (en.hasNext())
{
Row row = (Row)en.next();
System.out.println(row.getIndex() + ": " + row.getHeight());
}
getRowByIndex | |
public Row getRowByIndex(int index) |
-
Gets the row object by the position in the list.
- Parameters:
index - The position.
- Returns:
- The Row object at given position.
clear | |
public void clear() |
-
Clear all rows and cells.
removeAt | |
public void removeAt(int index) |
-
Remove the row at the specified index
- Parameters:
index - zero-based row index
See Also:
Aspose.Cells Documentation - the home page for the Aspose.Cells Product Documentation.
Aspose.Cells Support Forum - our preferred method of support.