|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectbrs.ANode<T>
abstract class ANode<T>
Represents the state of the owner binary tree structure. Union pattern
| Constructor Summary | |
|---|---|
ANode()
|
|
| Method Summary | ||
|---|---|---|
(package private) abstract
|
execute(BiTree<T> owner,
IVisitor<T,R,P> algo,
P... inp)
Calls the appropriate visitor's method to execute the visiting algorithm. |
|
(package private) abstract BiTree<T> |
getLeftSubTree(BiTree<T> owner)
Gets the left subtree of the owner tree. |
|
(package private) abstract BiTree<T> |
getRightSubTree(BiTree<T> owner)
Gets the right subtree of the owner tree. |
|
(package private) abstract T |
getRootDat(BiTree<T> owner)
Gets the root data of the owner tree if it exists. |
|
(package private) abstract void |
insertRoot(BiTree<T> owner,
T dat)
Inserts a root element to the owner tree. |
|
(package private) abstract T |
remRoot(BiTree<T> owner)
Removes and returns the root element from the owner tree. |
|
(package private) abstract void |
setLeftSubTree(BiTree<T> owner,
BiTree<T> biTree)
Sets the left subtree of the owner tree to a given tree. |
|
(package private) abstract void |
setRightSubTree(BiTree<T> owner,
BiTree<T> biTree)
Sets the right subtree of the owner tree to a given tree. |
|
(package private) abstract void |
setRootDat(BiTree<T> owner,
T dat)
Sets the root element of the owner tree to a given data object. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
ANode()
| Method Detail |
|---|
abstract T getRootDat(BiTree<T> owner)
owner - the BiTree that holds this node.
NoSuchElementException - if the owner is empty.
abstract void setRootDat(BiTree<T> owner,
T dat)
dat - owner - the BiTree that holds this node.
NoSuchElementException - if the owner is empty.abstract BiTree<T> getLeftSubTree(BiTree<T> owner)
owner - the BiTree that holds this node.
NoSuchElementException - if the owner is empty.abstract BiTree<T> getRightSubTree(BiTree<T> owner)
owner - the BiTree that holds this node.
NoSuchElementException - if the owner is empty.
abstract void setLeftSubTree(BiTree<T> owner,
BiTree<T> biTree)
biTree - != null.owner - the BiTree that holds this node.
NoSuchElementException - if the owner is empty.
abstract void setRightSubTree(BiTree<T> owner,
BiTree<T> biTree)
biTree - != null.owner - the BiTree that holds this node.
NoSuchElementException - if the owner is empty.
abstract void insertRoot(BiTree<T> owner,
T dat)
dat - owner - the BiTree that holds this node.
IllegaStateException - if the owner is not empty.abstract T remRoot(BiTree<T> owner)
dat - owner - the BiTree that holds this node.
IllegaStateException - if the owner has more than one element.
abstract <R,P> R execute(BiTree<T> owner,
IVisitor<T,R,P> algo,
P... inp)
owner - the BiTree that holds this node.algo - the visiting algorithminp - the vararg input the algorithm needs.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||