|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ITreeNode<T extends ITreeNode<T>>
Defines the node in a tree. The tree is defined from the root node. Each node can have
any number of children. To obtain tree-wide information and to manipulate the tree use
the GeneralTree
class.
Method Summary | |
---|---|
java.util.Iterator<T> |
ancestorIterator()
Iterator that traverses directly from this node up to the root node. |
java.util.Iterator<T> |
childIterator()
Iterator over the immediate children of this node. |
int |
getIndex()
Get the index (unique identifier) of this node. |
T |
getParent()
Get the parent node of this node. |
T |
getRoot()
Get the root node for the tree that this node belongs to. |
boolean |
isChild(T childNode)
Tests if childNode is a child of this node. |
boolean |
isParent(T parentNode)
Is the given node the parent node of this one? |
java.util.Iterator<T> |
levelOrderIterator()
Iterator that traverses down the tree in level-order, starting at this node. |
Method Detail |
---|
int getIndex()
T getRoot()
boolean isParent(T parentNode)
parentNode
- The node to test as a parent. Can be null.
T getParent()
boolean isChild(T childNode)
childNode
is a child of this node.
childNode
- The node to test, can be null.
java.util.Iterator<T> childIterator()
java.util.Iterator<T> ancestorIterator()
java.util.Iterator<T> levelOrderIterator()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |