K
- The type for the KeyV
- The type for the stored valuepublic interface Page<K,V>
PageIO
(they will be linked)Modifier and Type | Method and Description |
---|---|
TupleCursor<K,V> |
browse(K key,
Transaction<K,V> transaction,
ParentPos<K,V>[] stack,
int depth)
Browses the tree, looking for the given key, and creates a Cursor on top
of the found result.
|
TupleCursor<K,V> |
browse(Transaction<K,V> transaction,
ParentPos<K,V>[] stack,
int depth)
Browses the whole tree, and creates a Cursor on top of it.
|
boolean |
contains(K key,
V value)
Checks if the page contains the given key with the given value.
|
DeleteResult<K,V> |
delete(long revision,
K key,
V value,
Page<K,V> parent,
int parentPos)
Deletes the value from an entry associated with the given key in this page.
|
String |
dumpPage(String tabs)
Pretty-prints the tree with tabs
|
Tuple<K,V> |
findLeftMost()
Finds the leftmost element in this page.
|
int |
findPos(K key)
Find the position of the given key in the page.
|
Tuple<K,V> |
findRightMost()
Finds the rightmost element in this page.
|
V |
get(K key)
Gets the value associated with the given key, if any.
|
K |
getKey(int pos)
Returns the key at a given position
|
long |
getLastOffset() |
K |
getLeftMostKey()
Finds the leftmost key in this page.
|
int |
getNbElems() |
long |
getOffset() |
long |
getRevision() |
K |
getRightMostKey()
Finds the rightmost key in this page.
|
ValueCursor<V> |
getValues(K key)
Gets the values associated with the given key, if any.
|
boolean |
hasKey(K key)
Checks if the given key exists.
|
InsertResult<K,V> |
insert(long revision,
K key,
V value)
Inserts the given key and value into this page.
|
int getNbElems()
InsertResult<K,V> insert(long revision, K key, V value) throws IOException
revision
- The new revision for the modified pageskey
- Inserted keyvalue
- Inserted valueIOException
- If we have an error while trying to access the pageDeleteResult<K,V> delete(long revision, K key, V value, Page<K,V> parent, int parentPos) throws IOException
revision
- The new revision for the modified pageskey
- The key to deletevalue
- The value to delete (can be null)parent
- The parent pageparentPos
- The position of the current page in it's parentIOException
- If we have an error while trying to access the pageV get(K key) throws KeyNotFoundException, IOException
key
- The key we are looking forKeyNotFoundException
- If no entry with the given key can be foundIOException
- If we have an error while trying to access the pageValueCursor<V> getValues(K key) throws KeyNotFoundException, IOException, IllegalArgumentException
key
- The key we are looking forKeyNotFoundException
- If no entry with the given key can be foundIOException
- If we have an error while trying to access the pageIllegalArgumentException
- If duplicates are not enabledboolean contains(K key, V value) throws IOException
key
- The key we are looking forvalue
- The value associated with the given keyIOException
TupleCursor<K,V> browse(K key, Transaction<K,V> transaction, ParentPos<K,V>[] stack, int depth) throws IOException
key
- The key we are looking for.transaction
- The started transaction for this operationstack
- The stack of parents we go through to get to this pageIOException
- If we have an error while trying to access the pageTupleCursor<K,V> browse(Transaction<K,V> transaction, ParentPos<K,V>[] stack, int depth) throws EndOfFileExceededException, IOException
transaction
- The started transaction for this operationstack
- The stack of parents we go through to get to this pageIOException
- If we have an error while trying to access the pageEndOfFileExceededException
long getRevision()
K getKey(int pos)
pos
- The position of the key we want to retrieveK getLeftMostKey() throws IOException
IOException
- If we have an error while trying to access the pageK getRightMostKey() throws IOException
IOException
- If we have an error while trying to access the pageTuple<K,V> findLeftMost() throws IOException
IOException
- If we have an error while trying to access the pageTuple<K,V> findRightMost() throws EndOfFileExceededException, IOException
IOException
- If we have an error while trying to access the pageEndOfFileExceededException
String dumpPage(String tabs)
tabs
- The tabs to add in front of each nodeint findPos(K key)
+---+---+---+---+ | b | d | f | h | +---+---+---+---+ 0 1 2 3looking for 'b' will return -1 (-(0+1)) and looking for 'f' will return -3 (-(2+1)).
key
- The key to findboolean hasKey(K key) throws IOException
key
- The key we are looking atIOException
- If we have an error while trying to access the pagelong getOffset()
PageIO
which stores the Page on disk.long getLastOffset()
PageIO
which stores the Page on disk.Copyright © 2012-2013 Apache Mavibot Project Parent. All Rights Reserved.