Class TopLevelClass.Default.Node

java.lang.Object
  extended byTopLevelClass.Default.Node
All Implemented Interfaces:
TopLevelClass.Node
Direct Known Subclasses:
TopLevelClass.Default.ListOrNode, TopLevelClass.Default.Token, TopLevelClass.Default.Type
Enclosing class:
TopLevelClass.Default

public abstract static class TopLevelClass.Default.Node
extends java.lang.Object
implements TopLevelClass.Node

Provides a simple implementation of TopLevelClass.Node.

Since:
notavaCC 1.0

Constructor Summary
TopLevelClass.Default.Node(java.util.List childNodes)
          Constucts an instance.
 
Method Summary
 java.util.List getChildNodes()
          Returns the list of the child nodes of this.
 void replaceChild(TopLevelClass.Node oldChild, TopLevelClass.Node newChild)
          Replaces the child node oldChild with newChild.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TopLevelClass.Default.Node

public TopLevelClass.Default.Node(java.util.List childNodes)
Constucts an instance.

The returned list of getChildNodes() is the childNodes rather than a copy of it.

Parameters:
childNodes - a list of child nodes.
Since:
notavaCC 1.0
Method Detail

getChildNodes

public java.util.List getChildNodes()
Description copied from interface: TopLevelClass.Node
Returns the list of the child nodes of this.

For a Node created by the program generated by ¬<><∪∪, the list should be modifiable and the nodes should be ordered by its position in the parsed text. However, the nodes constructed by the users of ¬<><∪∪ are not required to satisfy it.

Specified by:
getChildNodes in interface TopLevelClass.Node
Returns:
the list of the child nodes of this.

replaceChild

public void replaceChild(TopLevelClass.Node oldChild,
                         TopLevelClass.Node newChild)
Replaces the child node oldChild with newChild.

This method replaces oldChild in getChildNodes() with newChild. Also, this method replaces the values returned by TopLevelClass.Type.label().

Parameters:
oldChild - a replaced child node.
newChild - a child node to replace oldChild.
Since:
notavaCC 1.0

toString

public java.lang.String toString()