|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.parboiled.trees.TreeUtils
public class TreeUtils
General utility methods for operating on tree, i.e. graphs consisting of TreeNode
s.
Method Summary | ||
---|---|---|
static
|
addChild(T parent,
T child)
Adds a new child node to a given MutableTreeNode parent. |
|
static
|
getRoot(T node)
Returns the root of the tree the given node is part of. |
|
static
|
removeChild(T parent,
T child)
Removes the given child from the given parent node. |
|
static
|
toLeftAssociativity(N node)
Performs the following transformation on the given MutableBinaryTreeNode: |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static <T extends TreeNode<T>> T getRoot(T node)
node
- the node to get the root of
public static <T extends MutableTreeNode<T>> void addChild(T parent, T child)
parent
- the parent nodechild
- the child node to addpublic static <T extends MutableTreeNode<T>> void removeChild(T parent, T child)
parent
- the parent nodechild
- the child nodepublic static <N extends MutableBinaryTreeNode<N>> N toLeftAssociativity(N node)
o1 o2 / \ / \ A o2 ====> o1 C / \ / \ B C A B
node
- the node to transform
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |