K - The type for the Keypublic class KeyCursor<K>
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private static int |
AFTER_LAST
A marker to tell that we are after the last element
|
private static int |
BEFORE_FIRST
A marker to tell that we are before the first element
|
protected int |
depth
The stack's depth
|
protected ParentPos<K,K>[] |
stack
The stack of pages from the root down to the leaf
|
protected ReadTransaction<K,K> |
transaction
The transaction used for this cursor
|
| Modifier | Constructor and Description |
|---|---|
protected |
KeyCursor()
Creates a new instance of Cursor.
|
|
KeyCursor(ReadTransaction<K,K> transaction,
ParentPos<K,K>[] stack,
int depth)
Creates a new instance of Cursor, starting on a page at a given position.
|
| Modifier and Type | Method and Description |
|---|---|
void |
afterLast()
Change the position in the current cursor to set it after the last key
|
void |
beforeFirst()
Change the position in the current cursor before the first key
|
void |
close() |
private ParentPos<K,K> |
findNextParentPos()
Find the leaf containing the following elements.
|
private ParentPos<K,K> |
findPrevParentPos()
Find the leaf containing the previous elements.
|
long |
getCreationDate()
Get the creation date
|
long |
getRevision()
Get the current revision
|
boolean |
hasNext()
Tells if the cursor can return a next element
|
boolean |
hasNextKey()
Tells if the cursor can return a next key
|
private boolean |
hasNextParentPos()
Tells if there is a next ParentPos
|
boolean |
hasPrev()
Tells if the cursor can return a previous element
|
boolean |
hasPrevKey()
Tells if the cursor can return a previous key
|
private boolean |
hasPrevParentPos()
Tells if there is a prev ParentPos
|
K |
next()
Find the next key
|
K |
nextKey()
Get the next key.
|
K |
prev()
Find the previous key
|
K |
prevKey()
Get the previous key.
|
java.lang.String |
toString() |
private static final int BEFORE_FIRST
private static final int AFTER_LAST
protected int depth
protected ReadTransaction<K,K> transaction
public void afterLast()
throws java.io.IOException
java.io.IOExceptionpublic void beforeFirst()
throws java.io.IOException
java.io.IOExceptionpublic boolean hasNext()
throws EndOfFileExceededException,
java.io.IOException
java.io.IOExceptionEndOfFileExceededExceptionpublic K next() throws EndOfFileExceededException, java.io.IOException
java.io.IOExceptionEndOfFileExceededExceptionpublic K nextKey() throws EndOfFileExceededException, java.io.IOException
EndOfFileExceededExceptionjava.io.IOExceptionpublic boolean hasNextKey()
throws EndOfFileExceededException,
java.io.IOException
java.io.IOExceptionEndOfFileExceededExceptionpublic boolean hasPrev()
throws EndOfFileExceededException,
java.io.IOException
java.io.IOExceptionEndOfFileExceededExceptionpublic K prev() throws EndOfFileExceededException, java.io.IOException
java.io.IOExceptionEndOfFileExceededExceptionpublic K prevKey() throws EndOfFileExceededException, java.io.IOException
EndOfFileExceededExceptionjava.io.IOExceptionpublic boolean hasPrevKey()
throws EndOfFileExceededException,
java.io.IOException
java.io.IOExceptionEndOfFileExceededExceptionprivate boolean hasNextParentPos()
throws EndOfFileExceededException,
java.io.IOException
java.io.IOExceptionEndOfFileExceededExceptionprivate ParentPos<K,K> findNextParentPos() throws EndOfFileExceededException, java.io.IOException
java.io.IOExceptionEndOfFileExceededExceptionprivate ParentPos<K,K> findPrevParentPos() throws EndOfFileExceededException, java.io.IOException
java.io.IOExceptionEndOfFileExceededExceptionprivate boolean hasPrevParentPos()
throws EndOfFileExceededException,
java.io.IOException
java.io.IOExceptionEndOfFileExceededExceptionpublic void close()
public long getCreationDate()
public long getRevision()
public java.lang.String toString()
toString in class java.lang.Object