-
- Type Parameters:
Node- - the type of nodes in the tree, aParseTreeis attached to the root of each subtree.
public interface ParseTree<Node>A non-empty tree ofParseTrees which can be traversed.The tree is a
ParseTreeand a(n array of) children (if there are no children this must be a zero-length array and must not benull). Each child in the array is aParseTree<Node>.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Node[]getChildNodes()Get the nodes of the immediate children of the root of the tree.ParseTree<Node>[]getChildren()Get the immediate children of the root of the tree.NodegetNode()intgetNumberOfChildren()Convenience method to avoid creating children prematurely.
-
-
-
Method Detail
-
getNode
Node getNode()
- Returns:
- the node at the root of the tree.
-
getNumberOfChildren
int getNumberOfChildren()
Convenience method to avoid creating children prematurely. Must be the same asgetChildren().length.- Returns:
- the number of children of the root.
-
getChildren
ParseTree<Node>[] getChildren()
Get the immediate children of the root of the tree.- Returns:
- an array of children.
-
-