org.apache.kahadb.index
Class BTreeNode<Key,Value>
java.lang.Object
org.apache.kahadb.index.BTreeNode<Key,Value>
public final class BTreeNode<Key,Value>
- extends java.lang.Object
The BTreeNode class represents a node in the BTree object graph. It is stored in
one Page of a PageFile.
Nested Class Summary |
static class |
BTreeNode.Marshaller<Key,Value>
The Marshaller is used to store and load the data in the BTreeNode into a Page. |
Method Summary |
void |
clear(Transaction tx)
|
boolean |
contains(Transaction tx,
Key key)
|
Value |
get(Transaction tx,
Key key)
|
java.util.Map.Entry<Key,Value> |
getFirst(Transaction tx)
|
BTreeNode<Key,Value> |
getFirstLeafNode(Transaction tx)
|
java.util.Map.Entry<Key,Value> |
getLast(Transaction tx)
|
int |
getMaxLeafDepth(Transaction tx,
int depth)
|
int |
getMinLeafDepth(Transaction tx,
int depth)
|
long |
getNext()
|
Page<BTreeNode<Key,Value>> |
getPage()
|
long |
getPageId()
|
BTreeNode<Key,Value> |
getParent()
|
boolean |
isEmpty(Transaction tx)
|
java.util.Iterator<java.util.Map.Entry<Key,Value>> |
iterator(Transaction tx)
|
java.util.Iterator<java.util.Map.Entry<Key,Value>> |
iterator(Transaction tx,
Key startKey)
|
void |
printStructure(Transaction tx,
java.io.PrintWriter out,
java.lang.String prefix)
|
Value |
put(Transaction tx,
Key key,
Value value)
|
Value |
remove(Transaction tx,
Key key)
|
void |
setEmpty()
|
void |
setNext(long next)
|
void |
setPage(Page<BTreeNode<Key,Value>> page)
|
void |
setParent(BTreeNode<Key,Value> parent)
|
java.lang.String |
toString()
|
void |
visit(Transaction tx,
BTreeVisitor<Key,Value> visitor)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
BTreeNode
public BTreeNode(BTreeIndex<Key,Value> index)
setEmpty
public void setEmpty()
remove
public Value remove(Transaction tx,
Key key)
throws java.io.IOException
- Throws:
java.io.IOException
put
public Value put(Transaction tx,
Key key,
Value value)
throws java.io.IOException
- Throws:
java.io.IOException
printStructure
public void printStructure(Transaction tx,
java.io.PrintWriter out,
java.lang.String prefix)
throws java.io.IOException
- Throws:
java.io.IOException
getMinLeafDepth
public int getMinLeafDepth(Transaction tx,
int depth)
throws java.io.IOException
- Throws:
java.io.IOException
getMaxLeafDepth
public int getMaxLeafDepth(Transaction tx,
int depth)
throws java.io.IOException
- Throws:
java.io.IOException
get
public Value get(Transaction tx,
Key key)
throws java.io.IOException
- Throws:
java.io.IOException
isEmpty
public boolean isEmpty(Transaction tx)
throws java.io.IOException
- Throws:
java.io.IOException
visit
public void visit(Transaction tx,
BTreeVisitor<Key,Value> visitor)
throws java.io.IOException
- Throws:
java.io.IOException
getFirst
public java.util.Map.Entry<Key,Value> getFirst(Transaction tx)
throws java.io.IOException
- Throws:
java.io.IOException
getLast
public java.util.Map.Entry<Key,Value> getLast(Transaction tx)
throws java.io.IOException
- Throws:
java.io.IOException
getFirstLeafNode
public BTreeNode<Key,Value> getFirstLeafNode(Transaction tx)
throws java.io.IOException
- Throws:
java.io.IOException
iterator
public java.util.Iterator<java.util.Map.Entry<Key,Value>> iterator(Transaction tx,
Key startKey)
throws java.io.IOException
- Throws:
java.io.IOException
iterator
public java.util.Iterator<java.util.Map.Entry<Key,Value>> iterator(Transaction tx)
throws java.io.IOException
- Throws:
java.io.IOException
clear
public void clear(Transaction tx)
throws java.io.IOException
- Throws:
java.io.IOException
contains
public boolean contains(Transaction tx,
Key key)
throws java.io.IOException
- Throws:
java.io.IOException
getPageId
public long getPageId()
getParent
public BTreeNode<Key,Value> getParent()
setParent
public void setParent(BTreeNode<Key,Value> parent)
getPage
public Page<BTreeNode<Key,Value>> getPage()
setPage
public void setPage(Page<BTreeNode<Key,Value>> page)
getNext
public long getNext()
setNext
public void setNext(long next)
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
Copyright © 2005-2012. All Rights Reserved.