edu.ksu.cis.projects.bogor.type
Class ArrayType

java.lang.Object
  extended by edu.ksu.cis.projects.bogor.type.Type
      extended by edu.ksu.cis.projects.bogor.type.NonPrimitiveType
          extended by edu.ksu.cis.projects.bogor.type.LockType
              extended by edu.ksu.cis.projects.bogor.type.ArrayType
All Implemented Interfaces:
Disposable, Serializable

public final class ArrayType
extends LockType

Represents an array type.

Version:
CVS $Revision: 1.2 $ $Date: 2005/01/29 04:54:31 $
Author:
Robby
See Also:
Serialized Form

Field Summary
 
Fields inherited from class edu.ksu.cis.projects.bogor.type.Type
hashCode, typeId
 
Constructor Summary
ArrayType(Type baseType, int rank)
          Default constructor.
 
Method Summary
 void dispose()
          Removes reference to baseType.
 boolean equals(Object o)
          Checks whether this object is equal to another object.
 Type getBaseType()
          Gets the base type.
 int getRank()
          Gets the rank.
 ASTType toASTType()
          Get a newly constructed (unowned) syntax tree node suitable for declaring this type statically.
 String toString()
          Returns the string representation of this object.
 
Methods inherited from class edu.ksu.cis.projects.bogor.type.Type
getTypeId, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ArrayType

public ArrayType(Type baseType,
                 int rank)
Default constructor.

Parameters:
baseType - The base type of this array. Must be non-null. Must be not instance of ArrayType, VoidType, or UnknownType.
rank - The rank of the array. Must be greater than zero.
Method Detail

getBaseType

public Type getBaseType()
Gets the base type.

Returns:
The base type. Non-null.

getRank

public int getRank()
Gets the rank.

Returns:
The rank. Greater than zero.

dispose

public void dispose()
Removes reference to baseType. Once called, avoid using this object.

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

equals

public boolean equals(Object o)
Checks whether this object is equal to another object.

Overrides:
equals in class LockType
Parameters:
o - Another object to check equality to.
Returns:
True, if the other object is also a collection type with the same element type and max record instances. False, otherwise.

toString

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

Overrides:
toString in class LockType
Returns:
"baseType([])^rank".

toASTType

public ASTType toASTType()
Get a newly constructed (unowned) syntax tree node suitable for declaring this type statically.

Overrides:
toASTType in class LockType
Returns:
the node, or null if the type is undeclarable