K - The type for the KeyV - The type for the stored valuepublic class TupleCursor<K,V>
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,V>[] |
stack
The stack of pages from the root down to the leaf
|
protected ReadTransaction<K,V> |
transaction
The transaction used for this cursor
|
| Modifier | Constructor and Description |
|---|---|
protected |
TupleCursor()
Creates a new instance of Cursor.
|
|
TupleCursor(ReadTransaction<K,V> transaction,
ParentPos<K,V>[] 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,V> |
findNextParentPos()
Find the leaf containing the following elements.
|
private ParentPos<K,V> |
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
|
Tuple<K,V> |
next()
Find the next key/value
|
Tuple<K,V> |
nextKey()
Get the next non-duplicate key.
|
Tuple<K,V> |
prev()
Find the previous key/value
|
Tuple<K,V> |
prevKey()
Get the previous non-duplicate key.
|
java.lang.String |
toString() |
private static final int BEFORE_FIRST
private static final int AFTER_LAST
protected int depth
protected ReadTransaction<K,V> 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 Tuple<K,V> next() throws EndOfFileExceededException, java.io.IOException
java.io.IOExceptionEndOfFileExceededExceptionpublic Tuple<K,V> 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 Tuple<K,V> prev() throws EndOfFileExceededException, java.io.IOException
java.io.IOExceptionEndOfFileExceededExceptionpublic Tuple<K,V> 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,V> findNextParentPos() throws EndOfFileExceededException, java.io.IOException
java.io.IOExceptionEndOfFileExceededExceptionprivate ParentPos<K,V> 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