edu.ksu.cis.projects.bogor.ast
Class TypeExtension

java.lang.Object
  extended by edu.ksu.cis.projects.bogor.ast.Node
      extended by edu.ksu.cis.projects.bogor.ast.Extension
          extended by edu.ksu.cis.projects.bogor.ast.TypeExtension
All Implemented Interfaces:
Disposable, Serializable, Cloneable

public class TypeExtension
extends Extension

Represents a type extension.

Version:
CVS $Revision: 1.7 $ $Date: 2005/05/06 17:25:17 $
Author:
Robby
See Also:
Serialized Form

Field Summary
 
Fields inherited from class edu.ksu.cis.projects.bogor.ast.Node
ILLEGAL_LOCAL_ID_CHAR
 
Constructor Summary
TypeExtension(boolean primitive, String id, List<String> typeVarIds)
          Default constructor.
 
Method Summary
 TypeExtension clone()
          Clones this object (deep clone); including location info.
 void dispose()
          Removes references.
 String getId()
          Gets the type extension id.
 boolean getPrimitive()
           
 String getTypeVariableId(int index)
          Gets the fixed type variable at a particular index.
 int getTypeVariableIdCount()
          Gets the number of fixed type variables.
 void setId(String newId)
          Sets the type extension id.
 void setPrimitive(boolean newPrimitive)
           
 void setTypeVarIds(List<String> newTypeVarIds)
          Sets the type var ids.
 String toString()
          Returns the string representation of this object.
 void visit(ASTVisitor visitor)
           
 
Methods inherited from class edu.ksu.cis.projects.bogor.ast.Extension
getParent, setParent
 
Methods inherited from class edu.ksu.cis.projects.bogor.ast.Node
getLocationInfo, getProperty, putProperty, setLocationInfo
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TypeExtension

public TypeExtension(boolean primitive,
                     String id,
                     List<String> typeVarIds)
Default constructor.

Parameters:
id - The extension type id. Must be non-null.
typeVarIds - The fixed type variable ids. Must be non-null. Each element must be instance of String. Each element must be distinct.
Method Detail

setId

public void setId(String newId)
Sets the type extension id.

Parameters:
newId - The new extension type id. Must be non-null.

getId

public String getId()
Gets the type extension id.

Returns:
The extension type id. Non-null.

setPrimitive

public void setPrimitive(boolean newPrimitive)

getPrimitive

public boolean getPrimitive()

setTypeVarIds

public void setTypeVarIds(List<String> newTypeVarIds)
Sets the type var ids.

Parameters:
newTypeVarIds - The fixed type variable ids. Must be non-null. Each element must be instance of String. Each element must be distinct.

getTypeVariableId

public String getTypeVariableId(int index)
Gets the fixed type variable at a particular index.

Parameters:
index - The index of the type variable. Must be at least zero and at most less than the number of fixed type variables.
Returns:
The fixed type variable at the given index.

getTypeVariableIdCount

public int getTypeVariableIdCount()
Gets the number of fixed type variables.

Returns:
The number of fixed type variables. At least zero.

clone

public TypeExtension clone()
Clones this object (deep clone); including location info.

Specified by:
clone in class Extension
Returns:
The clone of this object. Non-null.

dispose

public void dispose()
Removes references. Once called, avoid using this object.

Specified by:
dispose in interface Disposable
Overrides:
dispose in class Extension

toString

public String toString()
Returns the string representation of this object.

Specified by:
toString in class Node
Returns:
"typedef id[ <typevarid (, typevarid)* ];".

visit

public void visit(ASTVisitor visitor)
Specified by:
visit in class Node