Class TreeNodeList
java.lang.Object
TreeNode
TreeNodeList
- public class TreeNodeList
- extends TreeNode
TreeNodeList extends TreeNode by adding a node component and a siblings
component. The node is a reference to a single TreeNode. The siblings
component is a reference to a TreeNodeList, which may contain zero or more
additional TreeNodes. Hence, TreeNodeList is used to represent list
constructs in a parse tree. It can equivalently be viewed as a way to
represent n-ary constructs.
Method Summary |
java.lang.String |
toString(int level)
Return the String representation of this subtree, which is the recursive
toString of each of its nodes, separated by a ';' on a new line plus
another blank line. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
node
public TreeNode node
- Reference to the first node of this (sub)list.
siblings
public TreeNodeList siblings
- Reference to the rest of this (sub)list
TreeNodeList
public TreeNodeList(TreeNode node,
TreeNodeList siblings)
- Construct this with the given id and child TreeNode references.
toString
public java.lang.String toString(int level)
- Return the String representation of this subtree, which is the recursive
toString of each of its nodes, separated by a ';' on a new line plus
another blank line. See the documentation for TreeNode.toString() for a general
description the way trees are represented as strings.
- Specified by:
toString
in class TreeNode