The Cursor provides a variety of static utility methods to construct cursors with given characteristics or easily
search for specific values. For even friendlier and more flexible construction, see CursorBuilder.
Is not thread-safe.
| Modifier and Type | Class and Description |
|---|---|
| protected abstract class | CursorImpl.
Base implementation of iterator for this cursor, modifiable. |
| private class | CursorImpl.
Row iterator for this cursor, modifiable. |
| protected abstract static class | CursorImpl.
Handles moving the cursor in a given direction. |
| protected static class | CursorImpl.
Identifier for a cursor. |
| protected abstract static class | CursorImpl.
Value object which maintains the current position of the cursor. |
| private class | CursorImpl.
Row iterator for this cursor, modifiable. |
| private class | CursorImpl.
Row iterator for this cursor, modifiable. |
| protected static class | CursorImpl.
Value object which represents a complete save state of the cursor. |
| Modifier and Type | Field and Description |
|---|---|
| private static final Logger | |
| protected ColumnMatcher | mcolumnMatcher
ColumnMatcher to be used when matching column values |
| protected CursorImpl. | mcurPos
the current row |
| private final CursorImpl. | mfirstPos
the first (exclusive) row id for this cursor |
| private final CursorImpl. | mid
identifier for this cursor |
| private final CursorImpl. | mlastPos
the last (exclusive) row id for this cursor |
| public static final boolean | MOVE_FORWARD
boolean value indicating forward movement |
| public static final boolean | MOVE_REVERSE
boolean value indicating reverse movement |
| protected CursorImpl. | mprevPos
the previous row |
| private final TableImpl. | mrowState
State used for reading the table rows |
| private final TableImpl | mtable
owning table |
| Access | Constructor and Description |
|---|---|
| protected | CursorImpl(CursorImpl.
|
| Modifier and Type | Method and Description |
|---|---|
| public void | afterLast()
Implements io. Resets this cursor for reverse traversal (sets cursor to after the last row). |
| public void | beforeFirst()
Implements io. Resets this cursor for forward traversal (sets cursor to before the first row). |
| public static CursorImpl | createCursor(TableImpl
the table over which this cursor will traverse table)Creates a normal, un-indexed cursor for the given table. |
| public boolean | currentRowMatches(Column columnPattern, Object valuePattern)
Implements io. Returns |
| public boolean | |
| public boolean | currentRowMatches(Map<String, ?> rowPattern)
Implements io. Returns |
| protected boolean | |
| protected boolean | |
| protected final boolean | currentRowMatchesPattern(String columnPattern, Object valuePattern, ColumnMatcher columnMatcher, Object rowValue)
|
| public void | deleteCurrentRow()
Implements io. Delete the current row. |
| protected abstract CursorImpl. | findAnotherPosition(TableImpl.
Finds the next non-deleted row after the given row (as defined by this cursor) and returns the id of the row,
where "next" may be backwards if moveForward is |
| protected boolean | findAnotherRow(ColumnImpl columnPattern, Object valuePattern, boolean reset, boolean moveForward, ColumnMatcher columnMatcher, Object searchInfo)
|
| protected boolean | findAnotherRow(Map<String, ?> rowPattern, boolean reset, boolean moveForward, ColumnMatcher columnMatcher, Object searchInfo)
|
| protected boolean | Returns: true if a valid row was found with the given value, false if no row was foundcolumn from the table for this cursor which is being matched by the valuePattern columnPattern, Object value which is equal to the corresponding value in the matched row valuePattern, boolean moveForward, ColumnMatcher columnMatcher, Object searchInfo)Moves to the next row (as defined by the cursor) where the given column has the given value. |
| protected boolean | Returns: true if a valid row was found with the given values, false if no row was foundcolumn names and values which must be equal to the corresponding values in the matched row rowPattern, boolean moveForward, ColumnMatcher columnMatcher, Object searchInfo)Moves to the next row (as defined by the cursor) where the given columns have the given values. |
| public boolean | findFirstRow(Column columnPattern, Object valuePattern)
Implements io. Moves to the first row (as defined by the cursor) where the given column has the given value. |
| public boolean | |
| public boolean | findFirstRow(Map<String, ?> rowPattern)
Implements io. Moves to the first row (as defined by the cursor) where the given columns have the given values. |
| public boolean | findNextRow(Column columnPattern, Object valuePattern)
Implements io. Moves to the next row (as defined by the cursor) where the given column has the given value. |
| public boolean | |
| public boolean | findNextRow(Map<String, ?> rowPattern)
Implements io. Moves to the next row (as defined by the cursor) where the given columns have the given values. |
| public boolean | findRow(RowId rowId)
Implements io. Moves to the row with the given rowId. |
| private Row | Returns: another row in this table (Column name -> Column value), where "next" may be backwards if moveForward isfalse, or null if there is not another row in the given direction.Only column names in this collection will be returned columnNames, boolean moveForward)Moves to another row in the table based on the given direction and returns it. |
| public ColumnMatcher | getColumnMatcher()
Implements io. Returns the currently configured ColumnMatcher, always non- |
| public Row | getCurrentRow()
Implements io. Returns the current row in this cursor (Column name -> Column value). |
| public Row | getCurrentRow(Collection<String> columnNames)
Implements io. Returns the current row in this cursor (Column name -> Column value). |
| public Object | getCurrentRowValue(Column column)
Implements io. Returns the given column from the current row. |
| public Object | |
| protected ColumnMatcher | |
| protected abstract CursorImpl. | |
| public ErrorHandler | getErrorHandler()
Implements io. Gets the currently configured ErrorHandler (always non- |
| protected CursorImpl. | |
| public JetFormat | |
| public CursorImpl. | getId()
Implements io. Returns the unique identifier of this cursor, usable for validating a |
| protected CursorImpl. | |
| public Row | getNextRow()
Implements io. Moves to the next row in the table and returns it. |
| public Row | getNextRow(Collection<String> columnNames)
Implements io. Moves to the next row in the table and returns it. |
| public PageChannel | |
| public Row | getPreviousRow()
Implements io. Moves to the previous row in the table and returns it. |
| public Row | getPreviousRow(Collection<String> columnNames)
Implements io. Moves to the previous row in the table and returns it. |
| protected abstract CursorImpl. | getRowPosition(RowIdImpl rowId)
Returns the appropriate position information for the given row (which is the current row and is valid). |
| public TableImpl. | |
| public CursorImpl. | getSavepoint()
Implements io. Returns the current state of the cursor which can be restored at a future point in time by a call to
|
| public TableImpl | getTable()
Implements io. Returns the table over which this cursor iterates. |
| public boolean | isAfterLast()
Implements io. Returns |
| protected boolean | |
| public boolean | isBeforeFirst()
Implements io. Returns |
| public boolean | isCurrentRowDeleted()
Implements io. Returns |
| protected boolean | |
| protected boolean | isUpToDate()
Returns |
| public Iterator | iterator()
Implements io. Calls |
| public Iterator | |
| protected boolean | keepSearching(ColumnMatcher columnMatcher, Object searchInfo)
Called by findAnotherRowImpl to determine if the search should continue after finding a row which does not match the current pattern. |
| public int | moveNextRows(int numRows)
Implements io. Moves forward as many rows as possible up to the given number of rows. |
| public int | movePreviousRows(int numRows)
Implements io. Moves backward as many rows as possible up to the given number of rows. |
| private int | Returns: the number of rows moved.Moves as many rows as possible in the given direction up to the given number of rows. |
| protected boolean | Returns: true if another valid row was found in the given direction, false otherwiseMoves to another row in the given direction as defined by this cursor. |
| private boolean | moveToAnotherRowImpl(boolean moveForward)
Does the grunt work of moving the cursor to another position in the given direction. |
| public boolean | moveToNextRow()
Implements io. Moves to the next row as defined by this cursor. |
| public boolean | moveToPreviousRow()
Implements io. Moves to the previous row as defined by this cursor. |
| public IterableBuilder | newIterable()
Implements io. Convenience method for constructing a new IterableBuilder for this cursor. |
| protected Object | prepareSearchInfo(ColumnImpl columnPattern, Object valuePattern)
Called before a search commences to allow for search specific data to be generated (which is cached for re-use by the iterators). |
| protected Object | prepareSearchInfo(Map<String, ?> rowPattern)
Called before a search commences to allow for search specific data to be generated (which is cached for re-use by the iterators). |
| private boolean | Returns: true if the cursor ended up in a new position, false otherwise.Rechecks the current position if the underlying data structures have been modified. |
| public void | |
| protected void | |
| protected void | restorePosition(CursorImpl.
Restores a current position for the cursor (current position becomes previous position). |
| protected final void | restorePosition(CursorImpl.
Restores a current and previous position for the cursor if the given positions are different from the current positions. |
| protected void | restorePositionImpl(CursorImpl.
Restores a current and previous position for the cursor. |
| public void | restoreSavepoint(Cursor.
Implements io. Moves the cursor to a savepoint previously returned from |
| public void | |
| public void | setColumnMatcher(ColumnMatcher columnMatcher)
Implements io. Sets a new ColumnMatcher. |
| public void | setCurrentRowValue(Column column, Object value)
Implements io. Updates a single value in the current row. |
| public void | |
| public void | setErrorHandler(ErrorHandler newErrorHandler)
Implements io. Sets a new ErrorHandler. |
| public String | |
| public Object[] | updateCurrentRow(Object... row)
Implements io. Update the current row. |
| public <M extends Map | updateCurrentRowFromMap(M row)
Implements io. Update the current row. |