Class TreeNode1
java.lang.Object
TreeNode
TreeNode1
- 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. |
Constructor Summary |
TreeNode1(int id,
TreeNode child)
Construct this with the given id and child TreeNode reference. |
TreeNode1(int id,
TreeNode child,
int line,
int column)
A la the other constructor, but with line and column numbers. |
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
child
public TreeNode child
- Reference to the single child of this node.
TreeNode1
public TreeNode1(int id,
TreeNode child)
- Construct this with the given id and child TreeNode reference.
TreeNode1
public TreeNode1(int id,
TreeNode child,
int line,
int column)
- A la the other constructor, but with line and column numbers.
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