public interface TableRowIterator
extends java.io.Serializable
TableRowIterator
interface represents a collection of table rows, and provides methods for iterating through
the table rows either forwards or backwards, to address the underlying columns and their values.
Example:
var rows = tables.ORDERS.rows; while (rows.next()) { tables.ORDERS.ORDER_VAT.value = tables.ORDERS.ORDER_VALUE.value * vatRate; }
Modifier and Type | Method and Description |
---|---|
boolean |
first()
Sets the table's current row to point to the first row.
|
int |
getSize()
Returns the size i.e.
|
boolean |
last()
Sets the table's current row to point to the last row.
|
boolean |
next()
Sets the table's current row to point to the next table row and returns false if no more rows exist.
|
boolean |
previous()
Sets the table's current row to point to the previous table row and returns false if no more rows exist.
|
boolean next()
All table rows referenced by an iterator can be processed within a loop within while (iter.next())
as shown in
the example below.
When all rows have been processed by repeated calls to next()
,
this method returns false and the current row is reset to its original value
i.e the current row number before any methods on this TableRowIterator
were invoked.
If all rows are not processed i.e. this method does not return false, the current row is not reset.
Javascript example:
var orders = tables.ORDERS; var iter = orders.getRows(); while (iter.next()) { orders.ORDER_VAT.value = orders.ORDER_VALUE.value * vatRate; }
Table.getCurrentRow()
boolean previous()
next()
method except that rows are returned in reverse order. The current row can be positioned to
the last row using the last()
method}.Table.getCurrentRow()
boolean first()
Table.getCurrentRow()
boolean last()
Table.getCurrentRow()
int getSize()