Class TreeNode3

java.lang.Object
  extended byTreeNode
      extended byTreeNode3

public class TreeNode3
extends TreeNode

TreeNode3 extends TreeNode by adding three child components, which are references other TreeNodes. Hence, TreeNode3 is used to represent trinary syntactic constructs in a parse tree.


Field Summary
 TreeNode child1
          Reference to the left child of this node.
 TreeNode child2
          Reference to the middle child of this node.
 TreeNode child3
          Reference to the right child of this node.
 
Fields inherited from class TreeNode
id
 
Constructor Summary
TreeNode3(int id, TreeNode child1, TreeNode child2, TreeNode child3)
          Construct this with the given id and child TreeNode references.
 
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 three indented lines by the recursive toString of its three children.
 
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

child1

public TreeNode child1
Reference to the left child of this node.


child2

public TreeNode child2
Reference to the middle child of this node.


child3

public TreeNode child3
Reference to the right child of this node.

Constructor Detail

TreeNode3

public TreeNode3(int id,
                 TreeNode child1,
                 TreeNode child2,
                 TreeNode child3)
Construct this with the given id and child TreeNode references.

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 three indented lines by the recursive toString of its three children. See the documentation for TreeNode.toString() for a general description the way trees are represented as strings.

Specified by:
toString in class TreeNode