Holds the outcome of reading rows from a Table: the rows themselves (each a list of cell values), the total number of matching rows, the column headers, and the pagination parameters the rows were read with. Rows are built up one at a time by calling addRow to start a row, addCell or addCells to append values to it, and flush to commit it; a RowsResult is typically returned from a Table implementation's getRows method rather than constructed directly by report authors.
Properties
| Property | Returns | Description |
|---|---|---|
| currentRow | Row | The row currently being built by addRow and addCell, before it is committed with flush. Null once flushed or before the first row has been started. |
| headerLists | List<String> | Column header labels for this result, in the same order as the cell values in each row. |
| maxRows | Integer | The maximum number of rows requested for this page, as passed to Table.getRows. |
| numRows | long | Total number of rows matched by the query, which may be larger than the number of rows actually returned when the result is paged. Falls back to the number of rows currently held if no explicit count was set with setNumRows. |
| rows | List<List> | The rows read so far, each a list of cell values in the same order as getHeaderLists. |
| start | int | The zero based index of the first row in this page, as passed to Table.getRows. |
Methods
getNumRows() · setNumRows(Long numRows) · getRows() · getStart() · getMaxRows() · getHeaderLists() · getCurrentRow() · addRow() · addRow(Object source) · addCells(Object vals) · addCell(Object v) · flush()
getNumRows()
Returns: long
Total number of rows matched by the query, which may be larger than the number of rows actually returned when the result is paged. Falls back to the number of rows currently held if no explicit count was set with setNumRows.
setNumRows(Long numRows)
Returns: void
Sets the total number of rows matched by the query, independently of how many rows this result actually holds.
| Parameter | Description |
|---|---|
numRows | the total matched row count |
getRows()
Returns: List<List>
The rows read so far, each a list of cell values in the same order as getHeaderLists.
getStart()
Returns: int
The zero based index of the first row in this page, as passed to Table.getRows.
getMaxRows()
Returns: Integer
The maximum number of rows requested for this page, as passed to Table.getRows.
getHeaderLists()
Returns: List<String>
Column header labels for this result, in the same order as the cell values in each row.
getCurrentRow()
Returns: Row
The row currently being built by addRow and addCell, before it is committed with flush. Null once flushed or before the first row has been started.
addRow()
Returns: void
Starts a new row with no source object, first committing whichever row is currently in progress. Equivalent to calling addRow with a null source.
addRow(Object source)
Returns: void
Starts a new row, first committing whichever row is currently in progress by adding it to the result. Yields to the Governor so long running exports can be interrupted or throttled.
| Parameter | Description |
|---|---|
source | the domain object this row represents, or null if there is none |
addCells(Object vals)
Returns: void
Appends each of the given values as a cell to the row currently in progress, calling addCell for each one. Does nothing if vals is null.
| Parameter | Description |
|---|---|
vals | the cell values to append, in order |
addCell(Object v)
Returns: void
Appends a single value as a cell to the row currently in progress, starting a new row first if none is in progress. A null or otherwise empty value is stored as an empty string rather than null.
| Parameter | Description |
|---|---|
v | the cell value to append |
flush()
Returns: void
Commits the row currently in progress to the result, if there is one, and clears it so the next addRow starts a fresh row.