|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object AbstractNode
Field Summary | |
(package private) AbstractNode[] |
children
The children array is either null, for leaf nodes, or it contains pointers to each child node. |
(package private) java.lang.Integer[] |
keys
The keys array contains all the Integer keys in this node. |
(package private) static int |
maxNumKeys
This static class member indicates the maximum number of keys allowed in each node; it is set by the main program, and should not be changed after that. |
(package private) AbstractNode |
parent
The parent pointer indicates the parent of this node. |
(package private) int |
x
The x and y members are only used by the tree drawing class |
(package private) int |
y
|
Constructor Summary | |
(package private) |
AbstractNode(boolean _isLeaf,
AbstractNode _parent)
This is the standard constructor for BTree Nodes. |
Method Summary | |
(package private) abstract void |
delete(int i)
The delete method removes a key value from the tree. |
(package private) void |
dumpTreeToText()
This method outputs to standard out the a breadth-first text list of the keys in the tree. |
(package private) int |
getNumKeys()
This method gets the number of keys present in the node, which should be between numKeys (the max value), and numKeys/2 |
(package private) abstract void |
insert(int i)
The insert method inserts a new key value into the tree. |
(package private) abstract boolean |
search(int i)
The search method returns a boolean value indicating whether a certain key was found in the tree. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
static int maxNumKeys
java.lang.Integer[] keys
AbstractNode[] children
AbstractNode parent
int x
int y
Constructor Detail |
AbstractNode(boolean _isLeaf, AbstractNode _parent)
_isLeaf
- True if the node is a leaf node, and thus has no children.Method Detail |
int getNumKeys()
void dumpTreeToText()
abstract boolean search(int i)
i
- The key to search for.
abstract void insert(int i)
i
- The key to insert.abstract void delete(int i)
i
- The key to remove.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |