Class LeafNode

java.lang.Object
  extended byTreeNode
      extended byLeafNode

public class LeafNode
extends TreeNode

LeafNode extends TreeNode by adding an Object value field, but no subtree references.


Field Summary
 java.lang.Object value
          The generic value of this node, used for identifier names and literal values.
 
Fields inherited from class TreeNode
id
 
Constructor Summary
LeafNode(int id, java.lang.Object value)
          Construct with the given id and value.
 
Method Summary
 java.lang.String toString(int level)
          Return the string representation of this leaf, which starts with the String value of its ID.
 
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

value

public java.lang.Object value
The generic value of this node, used for identifier names and literal values.

Constructor Detail

LeafNode

public LeafNode(int id,
                java.lang.Object value)
Construct with the given id and value.

Method Detail

toString

public java.lang.String toString(int level)
Return the string representation of this leaf, which starts with the String value of its ID. If the value field of this leaf is not null, then the return value has appneded a colon, followed by the toString of the value.

Specified by:
toString in class TreeNode