public final class IndexData.EntryCursor
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
private class |
IndexData.EntryCursor.DirHandler
Handles moving the cursor in a given direction.
|
private class |
IndexData.EntryCursor.ForwardDirHandler
Handles moving the cursor forward.
|
private class |
IndexData.EntryCursor.ReverseDirHandler
Handles moving the cursor backward.
|
| Modifier and Type | Field and Description |
|---|---|
private IndexData.Position |
_curPos
the current entry
|
private IndexData.Position |
_firstPos
the first (exclusive) row id for this cursor
|
private IndexData.EntryCursor.DirHandler |
_forwardDirHandler
handler for moving the page cursor forward
|
private int |
_lastModCount
the last read modification count on the Index.
|
private IndexData.Position |
_lastPos
the last (exclusive) row id for this cursor
|
private IndexData.Position |
_prevPos
the previous entry
|
private IndexData.EntryCursor.DirHandler |
_reverseDirHandler
handler for moving the page cursor backward
|
| Modifier | Constructor and Description |
|---|---|
private |
EntryCursor(IndexData.Position firstPos,
IndexData.Position lastPos) |
| Modifier and Type | Method and Description |
|---|---|
void |
afterEntry(java.lang.Object[] row)
Repositions the cursor so that the previous row will be the first
entry <= the given row.
|
void |
afterLast() |
void |
beforeEntry(java.lang.Object[] row)
Repositions the cursor so that the next row will be the first entry
>= the given row.
|
void |
beforeFirst() |
private void |
checkForModification()
Checks the index for modifications and updates state accordingly.
|
private IndexData.Position |
getAnotherPosition(boolean moveForward)
Gets another entry in the given direction, returning the new entry.
|
private IndexData.EntryCursor.DirHandler |
getDirHandler(boolean moveForward)
Returns the DirHandler for the given direction
|
IndexData.Entry |
getFirstEntry()
Returns the first entry (exclusive) as defined by this cursor.
|
IndexData |
getIndexData() |
private int |
getIndexModCount() |
IndexData.Entry |
getLastEntry()
Returns the last entry (exclusive) as defined by this cursor.
|
IndexData.Entry |
getNextEntry() |
IndexData.Entry |
getPreviousEntry() |
boolean |
isUpToDate()
Returns
true if this cursor is up-to-date with respect to its
index. |
void |
reset() |
protected void |
reset(boolean moveForward) |
protected void |
restorePosition(IndexData.Entry curEntry)
Restores a current position for the cursor (current position becomes
previous position).
|
protected void |
restorePosition(IndexData.Entry curEntry,
IndexData.Entry prevEntry)
Restores a current and previous position for the cursor.
|
java.lang.String |
toString() |
private void |
updateBounds()
Updates any the boundary info (_firstPos/_lastPos).
|
private IndexData.Position |
updatePosition(IndexData.Entry entry)
Updates the given position, taking boundaries into account.
|
private final IndexData.EntryCursor.DirHandler _forwardDirHandler
private final IndexData.EntryCursor.DirHandler _reverseDirHandler
private IndexData.Position _firstPos
private IndexData.Position _lastPos
private IndexData.Position _curPos
private IndexData.Position _prevPos
private int _lastModCount
private EntryCursor(IndexData.Position firstPos, IndexData.Position lastPos)
private IndexData.EntryCursor.DirHandler getDirHandler(boolean moveForward)
public IndexData getIndexData()
private int getIndexModCount()
public IndexData.Entry getFirstEntry()
public IndexData.Entry getLastEntry()
public boolean isUpToDate()
true if this cursor is up-to-date with respect to its
index.public void reset()
public void beforeFirst()
public void afterLast()
protected void reset(boolean moveForward)
public void beforeEntry(java.lang.Object[] row)
throws java.io.IOException
java.io.IOExceptionpublic void afterEntry(java.lang.Object[] row)
throws java.io.IOException
java.io.IOExceptionpublic IndexData.Entry getNextEntry() throws java.io.IOException
#getLastEntry otherwisejava.io.IOExceptionpublic IndexData.Entry getPreviousEntry() throws java.io.IOException
#getFirstEntry otherwisejava.io.IOExceptionprotected void restorePosition(IndexData.Entry curEntry) throws java.io.IOException
java.io.IOExceptionprotected void restorePosition(IndexData.Entry curEntry, IndexData.Entry prevEntry) throws java.io.IOException
java.io.IOExceptionprivate IndexData.Position getAnotherPosition(boolean moveForward) throws java.io.IOException
java.io.IOExceptionprivate void checkForModification()
throws java.io.IOException
java.io.IOExceptionprivate IndexData.Position updatePosition(IndexData.Entry entry) throws java.io.IOException
java.io.IOExceptionprivate void updateBounds()
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Object