xtc.parser
Class ModuleList

java.lang.Object
  extended by xtc.tree.Node
      extended by xtc.parser.ModuleList
All Implemented Interfaces:
java.lang.Iterable<java.lang.Object>, Locatable

public class ModuleList
extends Node

A list of module names as a node.

Version:
$Revision: 1.12 $
Author:
Robert Grimm

Field Summary
 java.util.List<ModuleName> names
          The list of module names.
 
Constructor Summary
ModuleList(java.util.List<ModuleName> names)
          Create a new module list.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 ModuleName get(int idx)
          Get the module name at the specified index.
 int hashCode()
           
 boolean isEmpty()
          Determine whether this module list is empty.
 ModuleList rename(ModuleMap renaming)
          Rename this module list.
 int size()
          Get the size of this module list.
 java.lang.String toString()
          Return a human readable representation of this node.
 
Methods inherited from class xtc.tree.Node
add, add, addAll, addAll, addAll, addAll, addAllTo, addNode, contains, getBoolean, getBooleanProperty, getGeneric, getList, getLocation, getName, getNode, getProperty, getString, getStringProperty, getTokenText, hasLocation, hasName, hasProperty, hasTraversal, hasVariable, indexOf, isAnnotation, isGeneric, isList, isToken, iterator, lastIndexOf, properties, remove, removeProperty, set, setLocation, setLocation, setProperty, strip, toAnnotation, toList, toToken, write
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

names

public java.util.List<ModuleName> names
The list of module names.

Constructor Detail

ModuleList

public ModuleList(java.util.List<ModuleName> names)
Create a new module list.

Parameters:
names - The list of names.
Method Detail

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

isEmpty

public boolean isEmpty()
Determine whether this module list is empty.

Overrides:
isEmpty in class Node
Returns:
true if this is an empty module list.

size

public int size()
Get the size of this module list.

Overrides:
size in class Node
Returns:
The size.

get

public ModuleName get(int idx)
Get the module name at the specified index.

Overrides:
get in class Node
Parameters:
idx - The index.
Returns:
The module name at that position.
Throws:
java.lang.IndexOutOfBoundsException - Signals that the index is out of range.
See Also:
Token.test(Object), Token.cast(Object), GNode.test(Object), GNode.cast(Object)

rename

public ModuleList rename(ModuleMap renaming)
Rename this module list. This method renames all module names in this module list using the specified module map.

Parameters:
renaming - The module map.
Returns:
This list.

toString

public java.lang.String toString()
Description copied from class: Node
Return a human readable representation of this node. The default implementation creates a new string builder, writes this node to the builder, and then returns the corresponding string. Subclasses should typically override Node.write(Appendable).

Overrides:
toString in class Node
Returns:
A human readable representation.


Copyright © 2012. All Rights Reserved.