goldman.collection.ordered
Class BPlusTree.LeafNode
java.lang.Object
goldman.collection.ordered.AbstractSearchTree.TreeNode
goldman.collection.ordered.BPlusTree.LeafNode
- Enclosing class:
- BPlusTree<E>
public class BPlusTree.LeafNode
- extends AbstractSearchTree.TreeNode
Method Summary |
protected void |
addToParent(E element,
goldman.collection.ordered.BTree.BTreeNode right)
The node on which this method is called, becomes the left
child of element . |
protected int |
capacity()
|
protected goldman.collection.ordered.BTree.BTreeNode |
child(int i)
|
protected E |
data(int i)
|
protected boolean |
isFrontier()
|
protected goldman.collection.ordered.BTree.BTreeNode |
parent()
|
protected int |
size()
|
String |
toString()
|
BPlusTree.LeafNode
public BPlusTree.LeafNode()
toString
public String toString()
- Overrides:
toString
in class Object
isFrontier
protected boolean isFrontier()
- Specified by:
isFrontier
in class AbstractSearchTree.TreeNode
- Returns:
- true if and only if this node is a frontier node
size
protected int size()
- Specified by:
size
in class AbstractSearchTree.TreeNode
- Returns:
- the number of elements held in this node
capacity
protected int capacity()
- Specified by:
capacity
in class AbstractSearchTree.TreeNode
- Returns:
- the maximum number of elements
that can be held in a node.
parent
protected goldman.collection.ordered.BTree.BTreeNode parent()
- Returns:
- the parent of this node
data
protected E data(int i)
- Specified by:
data
in class AbstractSearchTree.TreeNode
- Parameters:
i
- the index of
the desired element
- Returns:
- the element with the given
index
- Throws:
PositionOutOfBoundsException
- i is not a valid index
child
protected goldman.collection.ordered.BTree.BTreeNode child(int i)
- Specified by:
child
in class AbstractSearchTree.TreeNode
- Parameters:
i
- the index for the
desired child
- Returns:
- a reference to the ith child
of this node
- Throws:
ArrayOutofBoundsException
- i is not between 0 and
2t-1
addToParent
protected void addToParent(E element,
goldman.collection.ordered.BTree.BTreeNode right)
- The node on which this method is called, becomes the left
child of
element
. This method creates a new
root, when it is called on the root
- Parameters:
element
- the element to
add to the parent of this noderight
- the reference to
a B-tree node to add as the right child of the new element