Class TreeNode1

java.lang.Object
  extended byTreeNode
      extended byTreeNode1

public class TreeNode1
extends TreeNode

TreeNode1 extends TreeNode by adding one child component, which is a reference to another TreeNode. Hence, TreeNode1 is used to represent unary syntactic constructs in a parse tree.


Field Summary
 TreeNode child
          Reference to the single child of this node.
 
Fields inherited from class TreeNode
id
 
Constructor Summary
TreeNode1(int id, TreeNode child)
          Construct this with the given id and child TreeNode reference.
 
Method Summary
 java.lang.String toString(int level)
          Return the String representation of this subtree, which is the String value of its ID, followed on the next indented line by the recursive toString of its child.
 
Methods inherited from class TreeNode
symPrint, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

child

public TreeNode child
Reference to the single child of this node.

Constructor Detail

TreeNode1

public TreeNode1(int id,
                 TreeNode child)
Construct this with the given id and child TreeNode reference.

Method Detail

toString

public java.lang.String toString(int level)
Return the String representation of this subtree, which is the String value of its ID, followed on the next indented line by the recursive toString of its child. See the documentation for TreeNode.toString() for a general description the way trees are represented as strings.

Specified by:
toString in class TreeNode