RowCollection
RowCollection class
Collects the Row objects that represent the individual rows in a worksheet.
class RowCollection;
Methods
Method | Description |
---|---|
get(number) | Gets a Row object by given row index. The Row object of given row index will be instantiated if it does not exist before. |
getCount() | Gets the number of rows in this collection. |
getEnumerator() | Gets an enumerator that iterates rows through this collection |
getEnumerator(boolean, boolean) | Gets an enumerator that iterates rows through this collection |
getRowByIndex(number) | Gets the row object by the position in the list. |
clear() | Clear all rows and cells. |
removeAt(number) | Remove the row item at the specified index(position) in this collection. |
isNull() | Checks whether the implementation object is null. |
get(number)
Gets a Row object by given row index. The Row object of given row index will be instantiated if it does not exist before.
get(rowIndex: number) : Row;
Parameters:
Parameter | Type | Description |
---|---|---|
rowIndex | number |
Returns
getCount()
Gets the number of rows in this collection.
getCount() : number;
getEnumerator()
Gets an enumerator that iterates rows through this collection
getEnumerator() : RowEnumerator;
Returns
enumerator
getEnumerator(boolean, boolean)
Gets an enumerator that iterates rows through this collection
getEnumerator(reversed: boolean, sync: boolean) : RowEnumerator;
Parameters:
Parameter | Type | Description |
---|---|---|
reversed | boolean | whether enumerate rows in reversed order |
sync | boolean | whether the returned enumerator should check the modification of row collection /// and keep synchronized with it. |
Returns
The row enumerator
Remarks
If the row collection will be modified(by operations that may cause new Row be instantiated or existing Row be removed) during the traversal with the enumerator, synchronized enumerator should be used instead of normal enumerator so that the traversal can continue from the position just after the one has been traversed by the last MoveNext(). However, together with the advantage that no element be skipped or traversed repeatedly, the disadvantage for synchronized enumerator is that the performance will be degraded a bit when comparing with normal enumerator.
getRowByIndex(number)
Gets the row object by the position in the list.
getRowByIndex(index: number) : Row;
Parameters:
Parameter | Type | Description |
---|---|---|
index | number | The position. |
Returns
The Row object at given position.
clear()
Clear all rows and cells.
clear() : void;
removeAt(number)
Remove the row item at the specified index(position) in this collection.
removeAt(index: number) : void;
Parameters:
Parameter | Type | Description |
---|---|---|
index | number | zero-based index(position, not Row.Index) of the existing row item in this collection. |
isNull()
Checks whether the implementation object is null.
isNull() : boolean;