org.axiondb.util
abstract class BaseBTree extends Object
Version: $Revision: 1.22 $ $Date: 2005/12/20 18:32:42 $
| Constructor Summary | |
|---|---|
| protected | BaseBTree(BTreeMetaData meta) |
| protected | BaseBTree(File dir, String name, int minimizationFactor) |
| Method Summary | |
|---|---|
| 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(IntList fileIds)
Add the given specified file ids. |
| protected void | clearData()
Clear my values and file ids. |
| protected BTreeMetaData | getBTreeMetaData() |
| protected 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 int | getValue(int index) |
| protected 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 abstract void | read() |
| abstract void | save() |
| void | save(File dataDirectory)
Saves the tree. |
| void | saveAfterTruncate() |
| protected void | saveCounterIfRoot() |
| protected void | setChildIds(IntList childIds) |
| protected void | setFileId(int fileId) |
| protected void | setValue(int index, int val) |
| protected void | setValues(IntList vals) |
| abstract int | size() |
| protected String | space(int n)
Return a String comprised of 2*n spaces. |
| void | truncate() |
| protected abstract void | write() |
Parameters: dir the directory to store my data files in name the name of this btree structure (used to generate data file names) minimizationFactor the minimization factor (often t ). Each node will contain at most 2 t -1 keys, and 2 t children. root the root of my tree (or null if this node is going to be the root).
minimizationFactor-1).true iff I don't contain any child nodes.true iff I am the root node.