Interface ParseTree<Node>

  • Type Parameters:
    Node - - the type of nodes in the tree, a ParseTree is attached to the root of each subtree.

    public interface ParseTree<Node>
    A non-empty tree of ParseTrees which can be traversed.

    The tree is a ParseTree and a(n array of) children (if there are no children this must be a zero-length array and must not be null). Each child in the array is a ParseTree<Node>.

    • 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 as getChildren().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.
      • getChildNodes

        Node[] getChildNodes()
        Get the nodes of the immediate children of the root of the tree.
        Returns:
        an array of ParseTrees.