Package com.ebasetech.xi.api
Interface TableRowIterator
- All Superinterfaces:
java.io.Serializable
public interface TableRowIterator
extends java.io.Serializable
The
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; }
- Since:
- V4.4
-
Method Summary
Modifier and Type Method 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.
-
Method Details
-
next
boolean next()Sets the table's current row to point to the next table row and returns false if no more rows exist.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 thisTableRowIterator
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; }
- Returns:
- false when all rows have been processed, true otherwise
- Since:
- V4.4
- See Also:
Table.getCurrentRow()
-
previous
boolean previous()Sets the table's current row to point to the previous table row and returns false if no more rows exist. This method works the same as thenext()
method except that rows are returned in reverse order. The current row can be positioned to the last row using thelast()
method}.- Returns:
- false when all rows have been processed, true otherwise
- Since:
- V4.4
- See Also:
Table.getCurrentRow()
-
first
boolean first()Sets the table's current row to point to the first row.- Returns:
- false when no rows exist, true otherwise
- Since:
- V4.4
- See Also:
Table.getCurrentRow()
-
last
boolean last()Sets the table's current row to point to the last row.- Returns:
- false when no rows exist, true otherwise
- Since:
- V4.4
- See Also:
Table.getCurrentRow()
-
getSize
int getSize()Returns the size i.e. number of rows, within the iterator.- Returns:
- number of rows
- Since:
- V4.4
-