org.axiondb.util
public class ObjectBTree extends BaseBTree
Object
s, based on the implementation described in
"Introduction to Algorithms" by Cormen, Leiserson and Rivest (CLR).
Version: $Revision: 1.53 $ $Date: 2005/12/20 18:32:42 $
Constructor Summary | |
---|---|
ObjectBTree(File idxDir, String idxName, int minimizationFactor, Comparator comp)
Create or load a new root node. | |
protected | ObjectBTree(BTreeMetaData meta, Comparator comp)
Create a new, non-root node. |
protected | ObjectBTree(BTreeMetaData meta, Comparator comp, int fileId)
Create a non-root node by reading it from disk. |
Method Summary | |
---|---|
protected void | addKeyValuePair(Object key, int value, boolean setDirty) |
void | clearData()
Clear my keys, values, and file ids. |
protected ObjectBTree | createNode(BTreeMetaData meta, Comparator comp)
Create a new node. |
void | delete(Object key, int rowid)
Optimized: Delete an arbitrary instance of the specified key and the specifiied
rowid |
Integer | get(Object key)
Find some occurance of the given key. |
IntListIterator | getAll(Object key)
Obtain an iterator over all values associated with the given key. |
IntListIterator | getAllExcludingNull()
Obtain an iterator over all values excluding null key values |
protected void | getAllExcludingNull(IntListIteratorChain chain) |
IntListIterator | getAllFrom(Object key)
Obtain an iterator over all values greater than or equal to the given key. |
IntListIterator | getAllTo(Object key)
Obtain an iterator over all values strictly less than the given key. |
protected Object | getKey(int index)
Obtain the key stored at the specified index. |
protected Object | getNullKey() |
IntListIteratorChain | inorderIterator() |
void | insert(Object key, int value)
Insert the given key/value pair. |
protected ObjectBTree | loadNode(BTreeMetaData meta, Comparator comp, int fileId)
Read the node with the specified fileId from disk. |
protected void | read()
Reads in the node. |
void | replaceId(Object key, int oldRowId, int newRowId)
Replace any occurance of oldRowId associated with the given key with newRowId. |
void | save()
Save this tree and all of its children.
|
int | size()
Returns the number of keys I currently contain. |
String | toString()
Obtain a String representation of this node, suitable for debugging. |
void | truncate() |
protected void | write()
Writes the node file out. |
Deprecated: See ObjectBTree
Save this tree and all of its children.minimizationFactor
-1 and at most
2*minimizationFactor
-1 for all nodes except the
root (which may have fewer than minimizationFactor
-1 keys).