public final class UsageMap.PageCursor
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
private class |
UsageMap.PageCursor.DirHandler
Handles moving the cursor in a given direction.
|
private class |
UsageMap.PageCursor.ForwardDirHandler
Handles moving the cursor forward.
|
private class |
UsageMap.PageCursor.ReverseDirHandler
Handles moving the cursor backward.
|
| Modifier and Type | Field and Description |
|---|---|
private int |
_curPageNumber
the current used page number
|
private UsageMap.PageCursor.DirHandler |
_forwardDirHandler
handler for moving the page cursor forward
|
private int |
_lastModCount
the last read modification count on the UsageMap.
|
private int |
_prevPageNumber
the previous used page number
|
private UsageMap.PageCursor.DirHandler |
_reverseDirHandler
handler for moving the page cursor backward
|
| Modifier | Constructor and Description |
|---|---|
private |
PageCursor() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterLast()
After calling this method,
getPreviousPage() will return the
last page in the map |
void |
beforeFirst()
After calling this method,
getNextPage() will return the first
page in the map |
private void |
checkForModification()
Checks the usage map for modifications an updates state accordingly.
|
private int |
getAnotherPage(boolean moveForward)
Gets another page in the given direction, returning the new page.
|
private UsageMap.PageCursor.DirHandler |
getDirHandler(boolean moveForward)
Returns the DirHandler for the given direction
|
int |
getNextPage() |
int |
getPreviousPage() |
UsageMap |
getUsageMap() |
boolean |
isUpToDate()
Returns
true if this cursor is up-to-date with respect to its
usage map. |
void |
reset()
After calling this method, getNextPage will return the first page in
the map
|
protected void |
reset(boolean moveForward)
Resets this page cursor for traversing the given direction.
|
private void |
restorePosition(int curPageNumber)
Restores a current position for the cursor (current position becomes
previous position).
|
protected void |
restorePosition(int curPageNumber,
int prevPageNumber)
Restores a current and previous position for the cursor.
|
java.lang.String |
toString() |
private int |
updatePosition(int pageNumber) |
private final UsageMap.PageCursor.DirHandler _forwardDirHandler
private final UsageMap.PageCursor.DirHandler _reverseDirHandler
private int _curPageNumber
private int _prevPageNumber
private int _lastModCount
public UsageMap getUsageMap()
private UsageMap.PageCursor.DirHandler getDirHandler(boolean moveForward)
public boolean isUpToDate()
true if this cursor is up-to-date with respect to its
usage map.public int getNextPage()
RowIdImpl.LAST_PAGE_NUMBER otherwisepublic int getPreviousPage()
RowIdImpl.FIRST_PAGE_NUMBER otherwiseprivate int getAnotherPage(boolean moveForward)
public void reset()
public void beforeFirst()
getNextPage() will return the first
page in the mappublic void afterLast()
getPreviousPage() will return the
last page in the mapprotected void reset(boolean moveForward)
private void restorePosition(int curPageNumber)
protected void restorePosition(int curPageNumber,
int prevPageNumber)
private void checkForModification()
private int updatePosition(int pageNumber)
public java.lang.String toString()
toString in class java.lang.Object