Class TopLevelClass.Default.Type

java.lang.Object
  |
  +--TopLevelClass.Default.Node
        |
        +--TopLevelClass.Default.Type
All Implemented Interfaces:
TopLevelClass.Node, TopLevelClass.Type
Enclosing class:
TopLevelClass.Default

public static class TopLevelClass.Default.Type
extends TopLevelClass.Default.Node
implements TopLevelClass.Type

An implementation of Type node.

Since:
notavaCC 1.0

Field Summary
 
Fields inherited from interface TopLevelClass.Type
ID
 
Constructor Summary
TopLevelClass.Default.Type(TopLevelClass.NodeInitializationParameters parameters, boolean compact)
          Constructs a instance with the child nodes given by parameters.
TopLevelClass.Default.Type(TopLevelClass.Type source)
          Constructs a instance with the child nodes given by source.getChildNodes() and source.
 
Method Summary
 List/Node label()
          Returns the child nodes labeled by label in the notavaCC source.
 void replaceChild(TopLevelClass.Node oldChild, TopLevelClass.Node newChild)
          Replaces the child node oldChild with newChild.
 
Methods inherited from class TopLevelClass.Default.Node
getChildNodes, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface TopLevelClass.Node
getChildNodes
 

Constructor Detail

TopLevelClass.Default.Type

public TopLevelClass.Default.Type(TopLevelClass.Type source)
Constructs a instance with the child nodes given by source.getChildNodes() and source.label(). List objects are copied.

Parameters:
source - the source.

TopLevelClass.Default.Type

public TopLevelClass.Default.Type(TopLevelClass.NodeInitializationParameters parameters,
                                  boolean compact)
Constructs a instance with the child nodes given by parameters.

Parameters:
parameters - the parameters for initialization.
compact - remove the children that are not labeled.
Method Detail

label

public List/Node label()
Description copied from interface: TopLevelClass.Type
Returns the child nodes labeled by label in the notavaCC source.

If the number of the labeled children should be zero or one, the type of the result is the most specific common type. In this case, if there is no labeled children, the result is null.

If the number of the labeled children may be greater than one, the type of the result is the List of the most specific common type. In this case, if there is no labeled children, the result isEmpty.

Note: Maybe the result will be an array rather than List in the future versions.

Specified by:
label in interface TopLevelClass.Type
Returns:
the child nodes labeled by label.

replaceChild

public void replaceChild(TopLevelClass.Node oldChild,
                         TopLevelClass.Node newChild)
Description copied from class: TopLevelClass.Default.Node
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().

Overrides:
replaceChild in class TopLevelClass.Default.Node
Parameters:
oldChild - a replaced child node.
newChild - a child node to replace oldChild.