A B D E G I M N R S T _

A

ANode<T> - Class in brs
Represents the state of the owner binary tree structure.
ANode() - Constructor for class brs.ANode
 

B

BiTree<T> - Class in brs
Models the binary tree structure using the state pattern and the visitor pattern.
BiTree() - Constructor for class brs.BiTree
Initializes this BiTree to the empty state.
brs - package brs
 
brs.visitor - package brs.visitor
 

D

DatNode<T> - Class in brs
Stores data and represents a non-empty state.
DatNode(T) - Constructor for class brs.DatNode
Initialize the data element to a given object.

E

emptyCase(BiTree<T>, P...) - Method in interface brs.IVisitor
Called by the host when the host is empty.
emptyCase(BiTree<T>, Void...) - Method in class brs.ToString
Returns "[]", a String representation of an empty binary tree.
emptyCase(BiTree<T>, String...) - Method in class brs.ToStringHelp
Returns "|_[]" to denote an empty tree subtree.
emptyCase(BiTree<T>, P...) - Method in class brs.visitor.InOrder1
 
emptyCase(BiTree<T>, P...) - Method in class brs.visitor.InOrder2
 
emptyCase(BiTree<T>, P...) - Method in class brs.visitor.InOrder3
 
emptyCase(BiTree<T>, Void...) - Method in class brs.visitor.InOrderPrint
 
EmptyNode<T> - Class in brs
Represents the empty state of a BiTree.
EmptyNode() - Constructor for class brs.EmptyNode
 
execute(BiTree<T>, IVisitor<T, R, P>, P...) - Method in class brs.ANode
Calls the appropriate visitor's method to execute the visiting algorithm.
execute(IVisitor<T, R, P>, P...) - Method in class brs.BiTree
Hook to execute any algorithm that presents itself as a visitor to this BiTree.
execute(BiTree<T>, IVisitor<T, R, P>, P...) - Method in class brs.DatNode
Calls algo's nonEmptyCase() method to execute the algorithm algo.
execute(BiTree<T>, IVisitor<T, R, P>, P...) - Method in class brs.EmptyNode
Calls algo's emptyCase () method to execute the algorithm algo.

G

getLeftSubTree(BiTree<T>) - Method in class brs.ANode
Gets the left subtree of the owner tree.
getLeftSubTree() - Method in class brs.BiTree
Gets the left subtree of this BiTree if it exists.
getLeftSubTree(BiTree<T>) - Method in class brs.DatNode
Gets the left subtree of the owner tree.
getLeftSubTree(BiTree<T>) - Method in class brs.EmptyNode
Throws java.util.NoSuchElementException.
getRightSubTree(BiTree<T>) - Method in class brs.ANode
Gets the right subtree of the owner tree.
getRightSubTree() - Method in class brs.BiTree
Gets the right subtree of this BiTree if it exsists.
getRightSubTree(BiTree<T>) - Method in class brs.DatNode
Gets the right subtree of the owner tree.
getRightSubTree(BiTree<T>) - Method in class brs.EmptyNode
Throws java.util.NoSuchElementException.
getRootDat(BiTree<T>) - Method in class brs.ANode
Gets the root data of the owner tree if it exists.
getRootDat() - Method in class brs.BiTree
Gets the root data of this BiTree if it exists.
getRootDat(BiTree<T>) - Method in class brs.DatNode
Gets the root data of the owner Tree.
getRootDat(BiTree<T>) - Method in class brs.EmptyNode
Throws java.util.NoSuchElementException.
getRootNode() - Method in class brs.BiTree
Returns the current node (i.e.

I

InOrder1<T,P> - Class in brs.visitor
Traverse a binary tree in order: For an empty tree: do the appropriate processing.
InOrder1(<any>) - Constructor for class brs.visitor.InOrder1
 
InOrder2<T,P> - Class in brs.visitor
Traverse a binary tree in order: For an empty tree: do the appropriate processing.
InOrder2(<any>, <any>) - Constructor for class brs.visitor.InOrder2
 
InOrder3<T,P> - Class in brs.visitor
Traverse a binary tree in order: For an empty tree: do the appropriate processing.
InOrder3(<any>, <any>, <any>) - Constructor for class brs.visitor.InOrder3
 
InOrderPrint<T> - Class in brs.visitor
Print all the numbers in a tree in in-order, line by line
InOrderPrint() - Constructor for class brs.visitor.InOrderPrint
 
insertRoot(BiTree<T>, T) - Method in class brs.ANode
Inserts a root element to the owner tree.
insertRoot(T) - Method in class brs.BiTree
Inserts a root element to this BiTree.
insertRoot(BiTree<T>, T) - Method in class brs.DatNode
Throws an IllegalStateException because the owner tree is not empty.
insertRoot(BiTree<T>, T) - Method in class brs.EmptyNode
Asks the owner tree to set the root node to a new DatNode containing dat, resulting in a state change from empty to non-empty.
IVisitor<T,R,P> - Interface in brs
Represents all extrinsic algorithms on a BiTree as a visitor to the BiTree host structure.

M

main(String[]) - Static method in class brs.visitor.InOrder1
 
main(String[]) - Static method in class brs.visitor.InOrder2
 
main(String[]) - Static method in class brs.visitor.InOrder3
 
main(String[]) - Static method in class brs.visitor.InOrderPrint
 

N

nonEmptyCase(BiTree<T>, P...) - Method in interface brs.IVisitor
Called by the host when the host is not empty.
nonEmptyCase(BiTree<T>, Void...) - Method in class brs.ToString
Computes a String representation of the binary tree host so that it can be printed vertically.
nonEmptyCase(BiTree<T>, String...) - Method in class brs.ToStringHelp
Computes a String representation of the binary tree host so that it can be printed vertically.
nonEmptyCase(BiTree<T>, P...) - Method in class brs.visitor.InOrder1
 
nonEmptyCase(BiTree<T>, P...) - Method in class brs.visitor.InOrder2
 
nonEmptyCase(BiTree<T>, P...) - Method in class brs.visitor.InOrder3
 
nonEmptyCase(BiTree<T>, Void...) - Method in class brs.visitor.InOrderPrint
 

R

remRoot(BiTree<T>) - Method in class brs.ANode
Removes and returns the root element from the owner tree.
remRoot() - Method in class brs.BiTree
Removes and returns the root data element of this BiTree.
remRoot(BiTree<T>) - Method in class brs.DatNode
Removes and returns the root element from the owner tree by asking the left subtree and, if necessary, the right subtree to help do the job.
remRoot(BiTree<T>) - Method in class brs.EmptyNode
Throws java.util.NoSuchElementException.

S

setLeftSubTree(BiTree<T>, BiTree<T>) - Method in class brs.ANode
Sets the left subtree of the owner tree to a given tree.
setLeftSubTree(BiTree<T>) - Method in class brs.BiTree
Attaches a new left subtree to the left of this BiTree, allowing this BiTree to grow to the left.
setLeftSubTree(BiTree<T>, BiTree<T>) - Method in class brs.DatNode
Sets the left subtree of this Datnode to a given tree.
setLeftSubTree(BiTree<T>, BiTree<T>) - Method in class brs.EmptyNode
Throws java.util.NoSuchElementException.
setRightSubTree(BiTree<T>, BiTree<T>) - Method in class brs.ANode
Sets the right subtree of the owner tree to a given tree.
setRightSubTree(BiTree<T>) - Method in class brs.BiTree
Attaches a new right subtree to the left of this BiTree, allowing this BiTree to grow to the right.
setRightSubTree(BiTree<T>, BiTree<T>) - Method in class brs.DatNode
Sets the right subtree of this node to a given tree.
setRightSubTree(BiTree<T>, BiTree<T>) - Method in class brs.EmptyNode
Throws java.util.NoSuchElementException.
setRootDat(BiTree<T>, T) - Method in class brs.ANode
Sets the root element of the owner tree to a given data object.
setRootDat(T) - Method in class brs.BiTree
Sets the root data element to a given object.
setRootDat(BiTree<T>, T) - Method in class brs.DatNode
Sets the data element of this node to a given data object.
setRootDat(BiTree<T>, T) - Method in class brs.EmptyNode
Throws java.util.NoSuchElementException.
setRootNode(ANode<T>) - Method in class brs.BiTree
Changes this BiTree to a given new node (i.e.

T

toString() - Method in class brs.BiTree
 
ToString<T> - Class in brs
Computes a String representation of the binary tree host so that it can be printed vertically.
ToString() - Constructor for class brs.ToString
 
ToStringHelp<T> - Class in brs
Computes a String representation of the binary tree host so that it can be printed vertically, given a leftmost leading string for the two subtrees.
ToStringHelp() - Constructor for class brs.ToStringHelp
 

_

_dat - Variable in class brs.DatNode
the stored data element.
_f - Variable in class brs.visitor.InOrder1
 
_fLeft - Variable in class brs.visitor.InOrder2
 
_fLeft - Variable in class brs.visitor.InOrder3
 
_fRight - Variable in class brs.visitor.InOrder2
 
_fRight - Variable in class brs.visitor.InOrder3
 
_fRoot - Variable in class brs.visitor.InOrder3
 
_leftTree - Variable in class brs.DatNode
Data Invariant: != null.
_rightTree - Variable in class brs.DatNode
Data Invariant: != null.
_rootNode - Variable in class brs.BiTree
the state of this BiTree.
_toString - Variable in class brs.BiTree
Visitor to generate string representation.
_toStringHelp - Variable in class brs.ToString
 

A B D E G I M N R S T _