public class StringBTree extends ObjectBTree
ObjectBTree
optimized for reading and writing Strings.Constructor and Description |
---|
StringBTree(java.io.File idxDir,
java.lang.String idxName,
int minimizationFactor,
java.util.Comparator comp)
Create or load a new root node.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addFileId(int fileId)
Add a reference to the given file id.
|
protected void |
addFileId(int index,
int fileid)
Store a reference to the given file id at the specifed index.
|
protected void |
addFileIds(org.apache.commons.collections.primitives.IntList fileIds)
Add the given specified file ids.
|
protected ObjectBTree |
createNode(org.axiondb.util.BTreeMetaData meta,
java.util.Comparator comp)
Create a new node.
|
protected org.axiondb.util.BTreeMetaData |
getBTreeMetaData() |
protected org.apache.commons.collections.primitives.IntList |
getChildIds() |
protected int |
getFileId() |
protected int |
getFileIdForIndex(int index)
Get the file id for the specified index.
|
protected int |
getKeyCapacity()
Return the maximum number of keys I can contain (2*
minimizationFactor -1). |
protected int |
getMinimizationFactor() |
protected java.lang.Object |
getNullKey() |
protected int |
getValue(int index) |
protected org.apache.commons.collections.primitives.IntList |
getValues() |
protected boolean |
isFull() |
protected boolean |
isLeaf()
Returns
true iff I don't contain any child nodes. |
protected boolean |
isRoot()
Returns
true iff I am the root node. |
protected ObjectBTree |
loadNode(org.axiondb.util.BTreeMetaData meta,
java.util.Comparator comp,
int fileId)
Read the node with the specified fileId from disk.
|
protected void |
read()
Reads in the node.
|
void |
save(java.io.File dataDirectory)
Saves the tree.
|
void |
saveAfterTruncate() |
protected void |
saveCounterIfRoot() |
protected void |
setChildIds(org.apache.commons.collections.primitives.IntList childIds) |
protected void |
setFileId(int fileId) |
protected void |
setValue(int index,
int val) |
protected void |
setValues(org.apache.commons.collections.primitives.IntList vals) |
protected java.lang.String |
space(int n)
Return a String comprised of 2*n spaces.
|
protected void |
write()
Writes the node file out.
|
addKeyValuePair, clearData, delete, get, getAll, getAllExcludingNull, getAllExcludingNull, getAllFrom, getAllTo, getKey, inorderIterator, insert, replaceId, save, size, toString, truncate
public StringBTree(java.io.File idxDir, java.lang.String idxName, int minimizationFactor, java.util.Comparator comp) throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
protected ObjectBTree createNode(org.axiondb.util.BTreeMetaData meta, java.util.Comparator comp) throws java.io.IOException, java.lang.ClassNotFoundException
ObjectBTree
createNode
in class ObjectBTree
java.io.IOException
java.lang.ClassNotFoundException
protected ObjectBTree loadNode(org.axiondb.util.BTreeMetaData meta, java.util.Comparator comp, int fileId) throws java.io.IOException, java.lang.ClassNotFoundException
ObjectBTree
loadNode
in class ObjectBTree
java.io.IOException
java.lang.ClassNotFoundException
protected void read() throws java.io.IOException, java.lang.ClassNotFoundException
ObjectBTree
read
in class ObjectBTree
java.io.IOException
java.lang.ClassNotFoundException
protected void write() throws java.io.IOException
ObjectBTree
write
in class ObjectBTree
java.io.IOException
protected java.lang.Object getNullKey()
getNullKey
in class ObjectBTree
public void save(java.io.File dataDirectory) throws java.io.IOException, java.lang.ClassNotFoundException
write()
s any dirty nodes.java.io.IOException
java.lang.ClassNotFoundException
public void saveAfterTruncate() throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
protected final void addFileId(int fileId)
protected final void addFileId(int index, int fileid)
protected final void addFileIds(org.apache.commons.collections.primitives.IntList fileIds)
protected final org.axiondb.util.BTreeMetaData getBTreeMetaData()
protected final org.apache.commons.collections.primitives.IntList getChildIds()
protected final int getFileId()
protected final int getFileIdForIndex(int index)
protected final int getKeyCapacity()
minimizationFactor
-1).protected final int getMinimizationFactor()
protected final int getValue(int index)
protected final org.apache.commons.collections.primitives.IntList getValues()
protected final boolean isFull()
protected final boolean isLeaf()
true
iff I don't contain any child nodes.protected final boolean isRoot()
true
iff I am the root node.protected final void saveCounterIfRoot() throws java.io.IOException
java.io.IOException
protected final void setChildIds(org.apache.commons.collections.primitives.IntList childIds)
protected final void setFileId(int fileId)
protected final void setValue(int index, int val)
protected final void setValues(org.apache.commons.collections.primitives.IntList vals)
protected final java.lang.String space(int n)