A B C D E G I M R S T U

A

add(Object) - Method in class TreeTest.OrderedVector
Override the Vector add(Object) method.

B

BinaryTree - class BinaryTree.
This class supports insertion and deletion of elements in a simple binary tree (e.g., the tree is not a balanced tree like an AVL tree or a red-black tree).
BinaryTree.Node - class BinaryTree.Node.
A binary tree node, where the associated data item is a generic Object.
BinaryTree.Node(Object) - Constructor for class BinaryTree.Node
When a Node is created, it is constructed with a left and right reference object.
BinaryTree.NodeReference - class BinaryTree.NodeReference.
A container for a reference
BinaryTree.NodeReference() - Constructor for class BinaryTree.NodeReference
 
BinaryTree(Comparator) - Constructor for class BinaryTree
The constructor is initialized with an instance of the Comparator interface, which supports the compare() method which is used to compare objects in the tree with a search key.

C

compare(Object, Object) - Method in class TreeTest.IntegerComparator
 

D

delete(BinaryTree.NodeReference, Object) - Method in class BinaryTree
This function searches a binary tree for "key" and deletes the item from the tree if it found.
delete(Object) - Method in class BinaryTree
Search the tree for an object which compares equal to key.

E

equals(Object) - Method in class TreeTest.IntegerComparator
 
equals(Object[], TreeTest.OrderedVector) - Method in class TreeTest
 

G

getLeft() - Method in class BinaryTree.Node
get the Node on the left branch
getLeftRef() - Method in class BinaryTree.Node
get a reference to the left branch
getObj() - Method in class BinaryTree.Node
get the Object associated with the Node
getRight() - Method in class BinaryTree.Node
get the Node on the right branch
getRightRef() - Method in class BinaryTree.Node
get a reference to the right branch

I

init() - Method in class BinaryTree.Node
Initialize the left and right links
insert(Object) - Method in class BinaryTree
Insert an object in the tree if it is not already present.

M

main(String[]) - Static method in class TreeTest
 
mCompare - Variable in class BinaryTree
Object used to compare Objects in the tree
mLeft - Variable in class BinaryTree.Node
Reference object for the left link
mNodeCount - Variable in class BinaryTree
Number of nodes in the binary tree
mObj - Variable in class BinaryTree.Node
key/data object associated with this node
mRight - Variable in class BinaryTree.Node
Reference object for the right link

R

ref - Variable in class BinaryTree.NodeReference
 
root - Variable in class BinaryTree
root of the binary tree

S

search(Object) - Method in class BinaryTree
Search for an object in the tree that compares equal to key.
searchAndInsert(BinaryTree.NodeReference, Object, boolean) - Method in class BinaryTree
Recursive tree search and insert.
setLeft(BinaryTree.Node) - Method in class BinaryTree.Node
set the Node on the left branch
setRight(BinaryTree.Node) - Method in class BinaryTree.Node
set the Node on the right branch
size() - Method in class BinaryTree
Return the number of data items (Objects) in the tree
spaces(int) - Method in class BinaryTree
Return a string consisting of count spaces.

T

toArray() - Method in class BinaryTree
Return an ordered array of tree objects, where Object values (as determined by the Comparator object used to initialize the BinaryTree constructor) increase with the array indices (e.g., the smallest value is at index 0, the largest value is at index n.
toArray(BinaryTree.Node, Vector) - Method in class BinaryTree
Recursively traverse the tree (using inorder tranversal) and insert the Objects from the tree into a Vector.
toString() - Method in class BinaryTree
Return a String which contains the tree represented in "landscape" form, running down the page.
toString(BinaryTree.NodeReference, PrintStream, int) - Method in class BinaryTree
Recursively build up a "landscape" display for the tree (e.g., a tree running down the page).
TreeTest - class TreeTest.
Unit test for the BinaryTree class
TreeTest.IntegerComparator - class TreeTest.IntegerComparator.
An object to compare two Integer objects.
TreeTest.IntegerComparator() - Constructor for class TreeTest.IntegerComparator
 
TreeTest.OrderedVector - class TreeTest.OrderedVector.
An ordered version of the Vector object.
TreeTest.OrderedVector() - Constructor for class TreeTest.OrderedVector
 
treeTest() - Method in class TreeTest
Test that values in the BinaryTree object are ordered properly and that object delete works properly.
TreeTest() - Constructor for class TreeTest
 

U

unlink(BinaryTree.NodeReference) - Method in class BinaryTree
When a value is removed from an ordered binary tree and the value has two children, it will be replaced by the next value in the right sub-branch which is greater.

A B C D E G I M R S T U