|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
T
- the actual implementation type of this TreeNodepublic interface MutableTreeNode<T extends MutableTreeNode<T>>
A TreeNode
specialiation that allow for mutability of the tree structure.
The three defined methods are all expected to properly uphold the trees "linking back" contract, where children
have their parent fields point to the node actually holding them in their children list at all times.
The three defined methods are the basic ones required, other convenience methods (like a simple addChild(child)
without index) are defined as static methods of the TreeUtils
class.
Method Summary | |
---|---|
void |
addChild(int index,
T child)
Adds the given child to this nodes children list and setting the childs parent field to this node. |
T |
removeChild(int index)
Removes the child with the given index. |
void |
setChild(int index,
T child)
Sets the child node at the given index to the given node. |
Methods inherited from interface org.parboiled.trees.TreeNode |
---|
getParent |
Methods inherited from interface org.parboiled.trees.GraphNode |
---|
getChildren |
Method Detail |
---|
void addChild(int index, T child)
index
- the index under which to insert this child into the children listchild
- the child node to addvoid setChild(int index, T child)
index
- the index under which to set this child into the children listchild
- the child node to setT removeChild(int index)
index
- the index of the child to remove.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |