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

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

public class ASTFunType
extends ASTType
implements ITypeParent

Functional type AST.

Version:
CVS $Revision: 1.10 $ $Date: 2005/06/09 18:48:15 $
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
ASTFunType(List<? extends ASTType> paramTypes, ASTType returnType)
          Default constructor.
 
Method Summary
 ASTFunType clone()
          Clones this object (deep clone); including location info.
 void dispose()
          Removes reference to parent.
 boolean equals(Object o)
           
 ASTType getParamType(int index)
          Gets the parameter type at a certain index.
 int getParamTypeCount()
          Gets the number of parameter types.
 ASTType getReturnType()
          Gets the return type of this functional type
 int hashCode()
           
 void setParamTypes(List<? extends ASTType> newParameterTypes)
          Sets the parameter types of this functional type.
 void setReturnType(ASTType newReturnType)
          Sets the return type of this functional type.
 String toString()
          Returns the string representation of this object.
 void visit(ASTVisitor visitor)
           
 
Methods inherited from class edu.ksu.cis.projects.bogor.ast.ASTType
getParent, setParent
 
Methods inherited from class edu.ksu.cis.projects.bogor.ast.Node
getLocationInfo, getProperty, putProperty, setLocationInfo
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ASTFunType

public ASTFunType(List<? extends ASTType> paramTypes,
                  ASTType returnType)
Default constructor.

Parameters:
paramTypes - The parameter types for this functional types. Must be non-null. Each element must be of type ASTType. Sets this functional type as each element's parent.
returnType - The return type of this functional type. Must be non-null. Sets this functional type as its parent.
Method Detail

getParamType

public ASTType getParamType(int index)
Gets the parameter type at a certain index.

Parameters:
index - The index of the parameter. Must be between 0 and getParamTypeCount() - 1.

getParamTypeCount

public int getParamTypeCount()
Gets the number of parameter types.

Returns:
The number of parameter types.

setParamTypes

public void setParamTypes(List<? extends ASTType> newParameterTypes)
Sets the parameter types of this functional type.

Parameters:
newParameterTypes - The new parameter types. Must be non-null. Each element must be of type ASTType. Sets this functional type as each element's parent.

setReturnType

public void setReturnType(ASTType newReturnType)
Sets the return type of this functional type.

Parameters:
newReturnType - The new return type of this functional type. Must be non-null. Sets this functional type as its parent.

getReturnType

public ASTType getReturnType()
Gets the return type of this functional type

Returns:
The return type of this functional type. Non-null.

clone

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

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

dispose

public void dispose()
Description copied from class: ASTType
Removes reference to parent. Once called, avoid using this object.

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

toString

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

Specified by:
toString in class Node
Returns:
"unit -> returnType" or "( * paramTypes )+ -> returnType.

visit

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

hashCode

public int hashCode()
Specified by:
hashCode in class ASTType

equals

public boolean equals(Object o)
Specified by:
equals in class ASTType