|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object brs.ANode<T> brs.EmptyNode<T>
class EmptyNode<T>
Represents the empty state of a BiTree. Uses the singleton pattern to model the uniqueness of "emptiness".
Constructor Summary | |
---|---|
EmptyNode()
|
Method Summary | ||
---|---|---|
(package private)
|
execute(BiTree<T> owner,
IVisitor<T,R,P> algo,
P... inp)
Calls algo's emptyCase () method to execute the algorithm algo. |
|
(package private) BiTree<T> |
getLeftSubTree(BiTree<T> owner)
Throws java.util.NoSuchElementException. |
|
(package private) BiTree<T> |
getRightSubTree(BiTree<T> owner)
Throws java.util.NoSuchElementException. |
|
(package private) T |
getRootDat(BiTree<T> owner)
Throws java.util.NoSuchElementException. |
|
(package private) void |
insertRoot(BiTree<T> owner,
T dat)
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. |
|
(package private) T |
remRoot(BiTree<T> owner)
Throws java.util.NoSuchElementException. |
|
(package private) void |
setLeftSubTree(BiTree<T> owner,
BiTree<T> biTree)
Throws java.util.NoSuchElementException. |
|
(package private) void |
setRightSubTree(BiTree<T> owner,
BiTree<T> biTree)
Throws java.util.NoSuchElementException. |
|
(package private) void |
setRootDat(BiTree<T> owner,
T dat)
Throws java.util.NoSuchElementException. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
EmptyNode()
Method Detail |
---|
T getRootDat(BiTree<T> owner)
getRootDat
in class ANode<T>
owner
- the BiTree holding this EmptyNode.
void setRootDat(BiTree<T> owner, T dat)
setRootDat
in class ANode<T>
dat
- a data Object.owner
- the BiTree holding this EmptyNode.BiTree<T> getLeftSubTree(BiTree<T> owner)
getLeftSubTree
in class ANode<T>
owner
- the BiTree holding this EmptyNode.
BiTree<T> getRightSubTree(BiTree<T> owner)
getRightSubTree
in class ANode<T>
owner
- the BiTree holding this EmptyNode.
void setLeftSubTree(BiTree<T> owner, BiTree<T> biTree)
setLeftSubTree
in class ANode<T>
biTree
- a given BiTree.owner
- the BiTree holding this EmptyNode.void setRightSubTree(BiTree<T> owner, BiTree<T> biTree)
setRightSubTree
in class ANode<T>
biTree
- a given BiTree.owner
- the BiTree holding this EmptyNode.void insertRoot(BiTree<T> owner, T dat)
insertRoot
in class ANode<T>
dat
- a given data Object.owner
- the context of this state.T remRoot(BiTree<T> owner)
remRoot
in class ANode<T>
owner
- the BiTree holding this EmptyNode.<R,P> R execute(BiTree<T> owner, IVisitor<T,R,P> algo, P... inp)
execute
in class ANode<T>
owner
- the BiTree holding this EmptyNode.algo
- the visiting algorithminp
- the vararg input algo needs.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |