Class LeafNode
java.lang.Object
TreeNode
LeafNode
- 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. |
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
value
public java.lang.Object value
- The generic value of this node, used for identifier names and literal
values.
LeafNode
public LeafNode(int id,
java.lang.Object value)
- Construct with the given id and value.
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