|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
T
- public interface ITree<T extends ITreeNode<T>>
A tree data structure. This class provides methods for manipulating the tree or querying the tree structure and characteristics.
Method Summary | |
---|---|
boolean |
containsNode(int testIndex)
|
boolean |
containsNode(T testNode)
|
T |
get(int testIndex)
|
T |
getLowestCommonAncestor(T thisNode,
T thatNode)
|
T |
getRootNode()
Get the root node of this tree. |
boolean |
isAncestor(T startNode,
T testNode)
Tests if testNode is an anscestor of startNode . |
boolean |
isDescendant(T startNode,
T testNode)
Tests if testNode is a descendent of startNode . |
java.util.Iterator<T> |
levelOrderIterator()
|
ITreeWalker<T> |
levelOrderTreeWalker(ITreeNodeAction<T> visitorAction)
Obtain a visitor that will traverse the tree from the root node in level-order. |
int |
size()
|
Method Detail |
---|
T getRootNode()
boolean containsNode(T testNode)
boolean containsNode(int testIndex)
T get(int testIndex)
T getLowestCommonAncestor(T thisNode, T thatNode)
boolean isDescendant(T startNode, T testNode)
testNode
is a descendent of startNode
. This means traversing
from the startNode
until it finds the testNode
.
startNode
- the node to start from, can be null.testNode
- the node to be tested, can be null.
true
if testNode
is an descendent of startNode
,
false
otherwise.boolean isAncestor(T startNode, T testNode)
testNode
is an anscestor of startNode
. This means traversing
from the startNode
until it finds the testNode
.
startNode
- the node to start from, can be null.testNode
- the node to be tested, can be null.
true
if testNode
is an ancestor of startNode
,
false
otherwise.java.util.Iterator<T> levelOrderIterator()
ITreeWalker<T> levelOrderTreeWalker(ITreeNodeAction<T> visitorAction)
visitorAction
will be performed.
visitorAction
- the action to be executed at each node visited.
int size()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |