public abstract class CursorImpl extends java.lang.Object implements Cursor
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 class |
CursorImpl.BaseIterator
Base implementation of iterator for this cursor, modifiable.
|
private class |
CursorImpl.ColumnMatchIterator
Row iterator for this cursor, modifiable.
|
protected class |
CursorImpl.DirHandler
Handles moving the cursor in a given direction.
|
protected static class |
CursorImpl.IdImpl
Identifier for a cursor.
|
protected static class |
CursorImpl.PositionImpl
Value object which maintains the current position of the cursor.
|
private class |
CursorImpl.RowIterator
Row iterator for this cursor, modifiable.
|
private class |
CursorImpl.RowMatchIterator
Row iterator for this cursor, modifiable.
|
protected static class |
CursorImpl.SavepointImpl
Value object which represents a complete save state of the cursor.
|
Cursor.Id, Cursor.Position, Cursor.Savepoint| Modifier and Type | Field and Description |
|---|---|
protected ColumnMatcher |
_columnMatcher
ColumnMatcher to be used when matching column values
|
protected CursorImpl.PositionImpl |
_curPos
the current row
|
private CursorImpl.PositionImpl |
_firstPos
the first (exclusive) row id for this cursor
|
private CursorImpl.IdImpl |
_id
identifier for this cursor
|
private CursorImpl.PositionImpl |
_lastPos
the last (exclusive) row id for this cursor
|
protected CursorImpl.PositionImpl |
_prevPos
the previous row
|
private TableImpl.RowState |
_rowState
State used for reading the table rows
|
private TableImpl |
_table
owning table
|
private static org.apache.commons.logging.Log |
LOG |
static boolean |
MOVE_FORWARD
boolean value indicating forward movement
|
static boolean |
MOVE_REVERSE
boolean value indicating reverse movement
|
| Modifier | Constructor and Description |
|---|---|
protected |
CursorImpl(CursorImpl.IdImpl id,
TableImpl table,
CursorImpl.PositionImpl firstPos,
CursorImpl.PositionImpl lastPos) |
| Modifier and Type | Method and Description |
|---|---|
void |
afterLast()
Resets this cursor for reverse traversal (sets cursor to after the last
row).
|
void |
beforeFirst()
Resets this cursor for forward traversal (sets cursor to before the first
row).
|
static CursorImpl |
createCursor(TableImpl table)
Creates a normal, un-indexed cursor for the given table.
|
boolean |
currentRowMatches(ColumnImpl columnPattern,
java.lang.Object valuePattern) |
boolean |
currentRowMatches(Column columnPattern,
java.lang.Object valuePattern)
Returns
true if the current row matches the given pattern. |
boolean |
currentRowMatches(java.util.Map<java.lang.String,?> rowPattern)
Returns
true if the current row matches the given pattern. |
protected boolean |
currentRowMatchesImpl(ColumnImpl columnPattern,
java.lang.Object valuePattern,
ColumnMatcher columnMatcher) |
protected boolean |
currentRowMatchesImpl(java.util.Map<java.lang.String,?> rowPattern,
ColumnMatcher columnMatcher) |
void |
deleteCurrentRow()
Delete the current row.
|
protected abstract CursorImpl.PositionImpl |
findAnotherPosition(TableImpl.RowState rowState,
CursorImpl.PositionImpl curPos,
boolean moveForward)
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
false. |
protected boolean |
findAnotherRow(ColumnImpl columnPattern,
java.lang.Object valuePattern,
boolean reset,
boolean moveForward,
ColumnMatcher columnMatcher,
java.lang.Object searchInfo) |
protected boolean |
findAnotherRow(java.util.Map<java.lang.String,?> rowPattern,
boolean reset,
boolean moveForward,
ColumnMatcher columnMatcher,
java.lang.Object searchInfo) |
protected boolean |
findAnotherRowImpl(ColumnImpl columnPattern,
java.lang.Object valuePattern,
boolean moveForward,
ColumnMatcher columnMatcher,
java.lang.Object searchInfo)
Moves to the next row (as defined by the cursor) where the given column
has the given value.
|
protected boolean |
findAnotherRowImpl(java.util.Map<java.lang.String,?> rowPattern,
boolean moveForward,
ColumnMatcher columnMatcher,
java.lang.Object searchInfo)
Moves to the next row (as defined by the cursor) where the given columns
have the given values.
|
boolean |
findFirstRow(ColumnImpl columnPattern,
java.lang.Object valuePattern) |
boolean |
findFirstRow(Column columnPattern,
java.lang.Object valuePattern)
Moves to the first row (as defined by the cursor) where the given column
has the given value.
|
boolean |
findFirstRow(java.util.Map<java.lang.String,?> rowPattern)
Moves to the first row (as defined by the cursor) where the given columns
have the given values.
|
boolean |
findNextRow(ColumnImpl columnPattern,
java.lang.Object valuePattern) |
boolean |
findNextRow(Column columnPattern,
java.lang.Object valuePattern)
Moves to the next row (as defined by the cursor) where the given column
has the given value.
|
boolean |
findNextRow(java.util.Map<java.lang.String,?> rowPattern)
Moves to the next row (as defined by the cursor) where the given columns
have the given values.
|
boolean |
findRow(RowId rowId)
Moves to the row with the given rowId.
|
private Row |
getAnotherRow(java.util.Collection<java.lang.String> columnNames,
boolean moveForward)
Moves to another row in the table based on the given direction and
returns it.
|
ColumnMatcher |
getColumnMatcher()
Returns the currently configured ColumnMatcher, always non-
null. |
Row |
getCurrentRow()
Returns the current row in this cursor (Column name -> Column value).
|
Row |
getCurrentRow(java.util.Collection<java.lang.String> columnNames)
Returns the current row in this cursor (Column name -> Column value).
|
java.lang.Object |
getCurrentRowValue(Column column)
Returns the given column from the current row.
|
java.lang.Object |
getCurrentRowValue(ColumnImpl column) |
protected ColumnMatcher |
getDefaultColumnMatcher()
Returns the default ColumnMatcher for this Cursor.
|
protected abstract CursorImpl.DirHandler |
getDirHandler(boolean moveForward)
Returns the DirHandler for the given movement direction.
|
ErrorHandler |
getErrorHandler()
Gets the currently configured ErrorHandler (always non-
null). |
protected CursorImpl.PositionImpl |
getFirstPosition()
Returns the first row id (exclusive) as defined by this cursor.
|
JetFormat |
getFormat() |
CursorImpl.IdImpl |
getId() |
protected CursorImpl.PositionImpl |
getLastPosition()
Returns the last row id (exclusive) as defined by this cursor.
|
Row |
getNextRow()
Moves to the next row in the table and returns it.
|
Row |
getNextRow(java.util.Collection<java.lang.String> columnNames)
Moves to the next row in the table and returns it.
|
PageChannel |
getPageChannel() |
Row |
getPreviousRow()
Moves to the previous row in the table and returns it.
|
Row |
getPreviousRow(java.util.Collection<java.lang.String> columnNames)
Moves to the previous row in the table and returns it.
|
protected abstract CursorImpl.PositionImpl |
getRowPosition(RowIdImpl rowId)
Returns the appropriate position information for the given row (which is
the current row and is valid).
|
TableImpl.RowState |
getRowState() |
CursorImpl.SavepointImpl |
getSavepoint()
Returns the current state of the cursor which can be restored at a future
point in time by a call to
Cursor.restoreSavepoint(com.healthmarketscience.jackcess.Cursor.Savepoint). |
TableImpl |
getTable() |
boolean |
isAfterLast()
Returns
true if the cursor is currently positioned after the
last row, false otherwise. |
protected boolean |
isAtBeginning(boolean moveForward) |
boolean |
isBeforeFirst()
Returns
true if the cursor is currently positioned before the
first row, false otherwise. |
boolean |
isCurrentRowDeleted()
Returns
true if the row at which the cursor is currently
positioned is deleted, false otherwise (including invalid rows). |
protected boolean |
isCurrentRowValid()
Returns
true of the current row is valid, false otherwise. |
protected boolean |
isUpToDate()
Returns
true if this cursor is up-to-date with respect to the
relevant table and related table objects, false otherwise. |
java.util.Iterator<Row> |
iterator()
Calls
Cursor.beforeFirst() on this cursor and returns a modifiable
Iterator which will iterate through all the rows of this table. |
java.util.Iterator<Row> |
iterator(IterableBuilder iterBuilder) |
protected boolean |
keepSearching(ColumnMatcher columnMatcher,
java.lang.Object searchInfo)
Called by findAnotherRowImpl to determine if the search should continue
after finding a row which does not match the current pattern.
|
int |
moveNextRows(int numRows)
Moves forward as many rows as possible up to the given number of rows.
|
int |
movePreviousRows(int numRows)
Moves backward as many rows as possible up to the given number of rows.
|
private int |
moveSomeRows(int numRows,
boolean moveForward)
Moves as many rows as possible in the given direction up to the given
number of rows.
|
protected boolean |
moveToAnotherRow(boolean moveForward)
Moves 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.
|
boolean |
moveToNextRow()
Moves to the next row as defined by this cursor.
|
boolean |
moveToPreviousRow()
Moves to the previous row as defined by this cursor.
|
IterableBuilder |
newIterable()
Convenience method for constructing a new IterableBuilder for this
cursor.
|
protected java.lang.Object |
prepareSearchInfo(ColumnImpl columnPattern,
java.lang.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 java.lang.Object |
prepareSearchInfo(java.util.Map<java.lang.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 |
recheckPosition(boolean moveForward)
Rechecks the current position if the underlying data structures have been
modified.
|
void |
reset()
Resets this cursor for forward traversal.
|
protected void |
reset(boolean moveForward)
Resets this cursor for traversing the given direction.
|
protected void |
restorePosition(CursorImpl.PositionImpl curPos)
Restores a current position for the cursor (current position becomes
previous position).
|
protected void |
restorePosition(CursorImpl.PositionImpl curPos,
CursorImpl.PositionImpl prevPos)
Restores a current and previous position for the cursor if the given
positions are different from the current positions.
|
protected void |
restorePositionImpl(CursorImpl.PositionImpl curPos,
CursorImpl.PositionImpl prevPos)
Restores a current and previous position for the cursor.
|
void |
restoreSavepoint(Cursor.Savepoint savepoint)
Moves the cursor to a savepoint previously returned from
Cursor.getSavepoint(). |
void |
restoreSavepoint(CursorImpl.SavepointImpl savepoint) |
void |
setColumnMatcher(ColumnMatcher columnMatcher)
Sets a new ColumnMatcher.
|
void |
setCurrentRowValue(ColumnImpl column,
java.lang.Object value) |
void |
setCurrentRowValue(Column column,
java.lang.Object value)
Updates a single value in the current row.
|
void |
setErrorHandler(ErrorHandler newErrorHandler)
Sets a new ErrorHandler.
|
java.lang.String |
toString() |
java.lang.Object[] |
updateCurrentRow(java.lang.Object... row)
Update the current row.
|
<M extends java.util.Map<java.lang.String,java.lang.Object>> |
updateCurrentRowFromMap(M row)
Update the current row.
|
private static final org.apache.commons.logging.Log LOG
public static final boolean MOVE_FORWARD
public static final boolean MOVE_REVERSE
private final CursorImpl.IdImpl _id
private final TableImpl _table
private final TableImpl.RowState _rowState
private final CursorImpl.PositionImpl _firstPos
private final CursorImpl.PositionImpl _lastPos
protected CursorImpl.PositionImpl _prevPos
protected CursorImpl.PositionImpl _curPos
protected ColumnMatcher _columnMatcher
protected CursorImpl(CursorImpl.IdImpl id, TableImpl table, CursorImpl.PositionImpl firstPos, CursorImpl.PositionImpl lastPos)
public static CursorImpl createCursor(TableImpl table)
table - the table over which this cursor will traversepublic TableImpl.RowState getRowState()
public CursorImpl.IdImpl getId()
public JetFormat getFormat()
public PageChannel getPageChannel()
public ErrorHandler getErrorHandler()
Cursornull).
This will be used to handle all errors.getErrorHandler in interface Cursorpublic void setErrorHandler(ErrorHandler newErrorHandler)
Cursornull, resets to using the
ErrorHandler configured at the Table level.setErrorHandler in interface Cursorpublic ColumnMatcher getColumnMatcher()
Cursornull.getColumnMatcher in interface Cursorpublic void setColumnMatcher(ColumnMatcher columnMatcher)
Cursornull, resets to using the default
matcher (default depends on Cursor type).setColumnMatcher in interface Cursorprotected ColumnMatcher getDefaultColumnMatcher()
public CursorImpl.SavepointImpl getSavepoint()
CursorCursor.restoreSavepoint(com.healthmarketscience.jackcess.Cursor.Savepoint).
Savepoints may be used across different cursor instances for the same
table, but they must have the same Cursor.Id.
getSavepoint in interface Cursorpublic void restoreSavepoint(Cursor.Savepoint savepoint) throws java.io.IOException
CursorCursor.getSavepoint().restoreSavepoint in interface Cursorjava.io.IOExceptionpublic void restoreSavepoint(CursorImpl.SavepointImpl savepoint) throws java.io.IOException
java.io.IOExceptionprotected CursorImpl.PositionImpl getFirstPosition()
protected CursorImpl.PositionImpl getLastPosition()
public void reset()
CursorCursor.beforeFirst().public void beforeFirst()
CursorbeforeFirst in interface Cursorpublic void afterLast()
Cursorpublic boolean isBeforeFirst()
throws java.io.IOException
Cursortrue if the cursor is currently positioned before the
first row, false otherwise.isBeforeFirst in interface Cursorjava.io.IOExceptionpublic boolean isAfterLast()
throws java.io.IOException
Cursortrue if the cursor is currently positioned after the
last row, false otherwise.isAfterLast in interface Cursorjava.io.IOExceptionprotected boolean isAtBeginning(boolean moveForward)
throws java.io.IOException
java.io.IOExceptionpublic boolean isCurrentRowDeleted()
throws java.io.IOException
Cursortrue if the row at which the cursor is currently
positioned is deleted, false otherwise (including invalid rows).isCurrentRowDeleted in interface Cursorjava.io.IOExceptionprotected void reset(boolean moveForward)
public java.util.Iterator<Row> iterator()
CursorCursor.beforeFirst() on this cursor and returns a modifiable
Iterator which will iterate through all the rows of this table. Use of
the Iterator follows the same restrictions as a call to
Cursor.getNextRow().
For more flexible iteration see Cursor.newIterable().public IterableBuilder newIterable()
CursornewIterable in interface Cursorpublic java.util.Iterator<Row> iterator(IterableBuilder iterBuilder)
public void deleteCurrentRow()
throws java.io.IOException
CursordeleteCurrentRow in interface Cursorjava.io.IOExceptionpublic java.lang.Object[] updateCurrentRow(java.lang.Object... row)
throws java.io.IOException
CursorupdateCurrentRow in interface Cursorjava.io.IOExceptionpublic <M extends java.util.Map<java.lang.String,java.lang.Object>> M updateCurrentRowFromMap(M row)
throws java.io.IOException
CursorupdateCurrentRowFromMap in interface Cursorjava.io.IOExceptionpublic Row getNextRow() throws java.io.IOException
CursorgetNextRow in interface Cursornull if no next row is foundjava.io.IOExceptionpublic Row getNextRow(java.util.Collection<java.lang.String> columnNames) throws java.io.IOException
CursorgetNextRow in interface CursorcolumnNames - Only column names in this collection will be returnednull if no next row is foundjava.io.IOExceptionpublic Row getPreviousRow() throws java.io.IOException
CursorgetPreviousRow in interface Cursornull if no previous row is foundjava.io.IOExceptionpublic Row getPreviousRow(java.util.Collection<java.lang.String> columnNames) throws java.io.IOException
CursorgetPreviousRow in interface CursorcolumnNames - Only column names in this collection will be returnednull if no previous row is foundjava.io.IOExceptionprivate Row getAnotherRow(java.util.Collection<java.lang.String> columnNames, boolean moveForward) throws java.io.IOException
columnNames - Only column names in this collection will be returnedfalse, or
null if there is not another row in the given direction.java.io.IOExceptionpublic boolean moveToNextRow()
throws java.io.IOException
CursormoveToNextRow in interface Cursortrue if a valid next row was found, false
otherwisejava.io.IOExceptionpublic boolean moveToPreviousRow()
throws java.io.IOException
CursormoveToPreviousRow in interface Cursortrue if a valid previous row was found, false
otherwisejava.io.IOExceptionprotected boolean moveToAnotherRow(boolean moveForward)
throws java.io.IOException
true if another valid row was found in the given
direction, false otherwisejava.io.IOExceptionprotected void restorePosition(CursorImpl.PositionImpl curPos) throws java.io.IOException
java.io.IOExceptionprotected final void restorePosition(CursorImpl.PositionImpl curPos, CursorImpl.PositionImpl prevPos) throws java.io.IOException
java.io.IOExceptionprotected void restorePositionImpl(CursorImpl.PositionImpl curPos, CursorImpl.PositionImpl prevPos) throws java.io.IOException
java.io.IOExceptionprivate boolean recheckPosition(boolean moveForward)
throws java.io.IOException
true if the cursor ended up in a new position,
false otherwise.java.io.IOExceptionprivate boolean moveToAnotherRowImpl(boolean moveForward)
throws java.io.IOException
java.io.IOExceptionpublic boolean findRow(RowId rowId) throws java.io.IOException
Cursorpublic boolean findFirstRow(Column columnPattern, java.lang.Object valuePattern) throws java.io.IOException
CursorWarning, this method always starts searching from the beginning of the Table (you cannot use it to find successive matches).
findFirstRow in interface CursorcolumnPattern - column from the table for this cursor which is being
matched by the valuePatternvaluePattern - value which is equal to the corresponding value in
the matched rowtrue if a valid row was found with the given value,
false if no row was foundjava.io.IOExceptionpublic boolean findFirstRow(ColumnImpl columnPattern, java.lang.Object valuePattern) throws java.io.IOException
java.io.IOExceptionpublic boolean findNextRow(Column columnPattern, java.lang.Object valuePattern) throws java.io.IOException
CursorfindNextRow in interface CursorcolumnPattern - column from the table for this cursor which is being
matched by the valuePatternvaluePattern - value which is equal to the corresponding value in
the matched rowtrue if a valid row was found with the given value,
false if no row was foundjava.io.IOExceptionpublic boolean findNextRow(ColumnImpl columnPattern, java.lang.Object valuePattern) throws java.io.IOException
java.io.IOExceptionprotected boolean findAnotherRow(ColumnImpl columnPattern, java.lang.Object valuePattern, boolean reset, boolean moveForward, ColumnMatcher columnMatcher, java.lang.Object searchInfo) throws java.io.IOException
java.io.IOExceptionpublic boolean findFirstRow(java.util.Map<java.lang.String,?> rowPattern)
throws java.io.IOException
CursorWarning, this method always starts searching from the beginning of the Table (you cannot use it to find successive matches).
findFirstRow in interface CursorrowPattern - column names and values which must be equal to the
corresponding values in the matched rowtrue if a valid row was found with the given values,
false if no row was foundjava.io.IOExceptionpublic boolean findNextRow(java.util.Map<java.lang.String,?> rowPattern)
throws java.io.IOException
CursorfindNextRow in interface CursorrowPattern - column names and values which must be equal to the
corresponding values in the matched rowtrue if a valid row was found with the given values,
false if no row was foundjava.io.IOExceptionprotected boolean findAnotherRow(java.util.Map<java.lang.String,?> rowPattern,
boolean reset,
boolean moveForward,
ColumnMatcher columnMatcher,
java.lang.Object searchInfo)
throws java.io.IOException
java.io.IOExceptionpublic boolean currentRowMatches(Column columnPattern, java.lang.Object valuePattern) throws java.io.IOException
Cursortrue if the current row matches the given pattern.currentRowMatches in interface CursorcolumnPattern - column from the table for this cursor which is being
matched by the valuePatternvaluePattern - value which is tested for equality with the
corresponding value in the current rowjava.io.IOExceptionpublic boolean currentRowMatches(ColumnImpl columnPattern, java.lang.Object valuePattern) throws java.io.IOException
java.io.IOExceptionprotected boolean currentRowMatchesImpl(ColumnImpl columnPattern, java.lang.Object valuePattern, ColumnMatcher columnMatcher) throws java.io.IOException
java.io.IOExceptionpublic boolean currentRowMatches(java.util.Map<java.lang.String,?> rowPattern)
throws java.io.IOException
Cursortrue if the current row matches the given pattern.currentRowMatches in interface CursorrowPattern - column names and values which must be equal to the
corresponding values in the current rowjava.io.IOExceptionprotected boolean currentRowMatchesImpl(java.util.Map<java.lang.String,?> rowPattern,
ColumnMatcher columnMatcher)
throws java.io.IOException
java.io.IOExceptionprotected boolean findAnotherRowImpl(ColumnImpl columnPattern, java.lang.Object valuePattern, boolean moveForward, ColumnMatcher columnMatcher, java.lang.Object searchInfo) throws java.io.IOException
Default implementation scans the table from beginning to end.
columnPattern - column from the table for this cursor which is being
matched by the valuePatternvaluePattern - value which is equal to the corresponding value in
the matched rowtrue if a valid row was found with the given value,
false if no row was foundjava.io.IOExceptionprotected boolean findAnotherRowImpl(java.util.Map<java.lang.String,?> rowPattern,
boolean moveForward,
ColumnMatcher columnMatcher,
java.lang.Object searchInfo)
throws java.io.IOException
Default implementation scans the table from beginning to end.
rowPattern - column names and values which must be equal to the
corresponding values in the matched rowtrue if a valid row was found with the given values,
false if no row was foundjava.io.IOExceptionprotected java.lang.Object prepareSearchInfo(ColumnImpl columnPattern, java.lang.Object valuePattern)
protected java.lang.Object prepareSearchInfo(java.util.Map<java.lang.String,?> rowPattern)
protected boolean keepSearching(ColumnMatcher columnMatcher, java.lang.Object searchInfo) throws java.io.IOException
java.io.IOExceptionpublic int moveNextRows(int numRows)
throws java.io.IOException
CursormoveNextRows in interface Cursorjava.io.IOExceptionpublic int movePreviousRows(int numRows)
throws java.io.IOException
CursormovePreviousRows in interface Cursorjava.io.IOExceptionprivate int moveSomeRows(int numRows,
boolean moveForward)
throws java.io.IOException
java.io.IOExceptionpublic Row getCurrentRow() throws java.io.IOException
CursorgetCurrentRow in interface Cursorjava.io.IOExceptionpublic Row getCurrentRow(java.util.Collection<java.lang.String> columnNames) throws java.io.IOException
CursorgetCurrentRow in interface CursorcolumnNames - Only column names in this collection will be returnedjava.io.IOExceptionpublic java.lang.Object getCurrentRowValue(Column column) throws java.io.IOException
CursorgetCurrentRowValue in interface Cursorjava.io.IOExceptionpublic java.lang.Object getCurrentRowValue(ColumnImpl column) throws java.io.IOException
java.io.IOExceptionpublic void setCurrentRowValue(Column column, java.lang.Object value) throws java.io.IOException
CursorsetCurrentRowValue in interface Cursorjava.io.IOExceptionpublic void setCurrentRowValue(ColumnImpl column, java.lang.Object value) throws java.io.IOException
java.io.IOExceptionprotected boolean isUpToDate()
true if this cursor is up-to-date with respect to the
relevant table and related table objects, false otherwise.protected boolean isCurrentRowValid()
throws java.io.IOException
true of the current row is valid, false otherwise.java.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Objectprotected abstract CursorImpl.PositionImpl getRowPosition(RowIdImpl rowId) throws java.io.IOException
java.io.IOExceptionprotected abstract CursorImpl.PositionImpl findAnotherPosition(TableImpl.RowState rowState, CursorImpl.PositionImpl curPos, boolean moveForward) throws java.io.IOException
false. If there are no more rows, the returned
rowId should equal the value returned by getLastPosition() if
moving forward and getFirstPosition() if moving backward.java.io.IOExceptionprotected abstract CursorImpl.DirHandler getDirHandler(boolean moveForward)