|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.ksu.cis.projects.bogor.type.TypeFactory
public final class TypeFactory
Provides a factory for types. The types are cached so, there is only one instance for each unique type.
Field Summary | |
---|---|
static int |
UNUSABLE_TYPE_ID
Holds the unusable type id. |
Constructor Summary | |
---|---|
TypeFactory()
Default constructor. |
Method Summary | |
---|---|
void |
disallowNew()
Treat any request for an uncached type from this point forward as a programming error (generate an exception). |
void |
dispose()
Removes references to booleanType, intType, lockType, voidType, nullType, unknownType, and clears cache. |
ArrayType |
getArrayType(Type baseType,
int rank)
Gets an array type. |
BooleanType |
getBooleanType()
Gets a boolean type. |
DoubleType |
getDoubleType()
Gets an double type. |
EnumType |
getEnumType(String id)
Gets an enum type. |
NonPrimitiveExtType |
getExtType(String id,
Type[] argTypes)
Gets an ext type. |
FloatType |
getFloatType()
Gets a float type. |
FunType |
getFunType(Type[] paramTypes,
Type returnType)
Gets a fun type. |
IntRangeType |
getIntRangeType(int lowLimit,
int highLimit,
boolean wrap)
Gets an int range type. |
IntType |
getIntType()
Gets an int type. |
LockType |
getLockType()
Gets a lock type. |
LongRangeType |
getLongRangeType(long lowLimit,
long highLimit,
boolean wrap)
Gets a long range type. |
LongType |
getLongType()
Gets a long type. |
NullType |
getNullType()
Gets a null type. |
PrimitiveExtType |
getPrimitiveExtType(String id,
Type[] argTypes)
Gets a primitive ext type. |
PrimitiveTypeExtensionType |
getPrimitiveTypeExtensionType(String id,
String[] typeVarIds)
Gets a primtive type extension type. |
RecordType |
getRecordType(String id)
Gets a record type. |
StringType |
getStringType()
Gets a string type. |
ThreadIdType |
getThreadIdType()
Gets a thread id type. |
TypeExtensionType |
getTypeExtensionType(String id,
String[] typeVarIds)
Gets a type extension type. |
Set<Type> |
getTypeSet()
Gets a set of types created/returned from this factory. |
UnknownType |
getUnknownType()
Gets an unknown type. |
VoidType |
getVoidType()
Gets a void type. |
TypeVar |
geTypeVar(String id)
Gets a type var. |
Type |
instantiate(Type type,
Map<String,Type> typeVarTypeTable)
Instantiate a type. |
void |
remove(Type type)
Removes a type from the cache. |
String |
toString()
Returns the string representation of this object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int UNUSABLE_TYPE_ID
Constructor Detail |
---|
public TypeFactory()
Method Detail |
---|
public void disallowNew()
public ArrayType getArrayType(Type baseType, int rank)
baseType
- The base type of this array. Must be non-null. Must be not
instance of ASTArrayType, VoidType, or UnknownType.rank
- The rank of the array. Must be greater than zero.
public BooleanType getBooleanType()
public DoubleType getDoubleType()
public EnumType getEnumType(String id)
id
- The id of the enum type. Must be non-null.
public NonPrimitiveExtType getExtType(String id, Type[] argTypes)
id
- The id of the ext type. Must be non-null.argTypes
- The arguments for type variables. Must be non-null. Each
element must be non-null.
public FloatType getFloatType()
public FunType getFunType(Type[] paramTypes, Type returnType)
paramTypes
- The parameter types. Must be non-null. Each element must be
non-null.returnType
- The return type
public IntRangeType getIntRangeType(int lowLimit, int highLimit, boolean wrap)
lowLimit
- The low limit.highLimit
- The high limit. Must be at least equal to the low limit.wrap
- Indicates whether to support wrap around for the int range
type.
public IntType getIntType()
public LockType getLockType()
public LongRangeType getLongRangeType(long lowLimit, long highLimit, boolean wrap)
lowLimit
- The low limit.highLimit
- The high limit. Must be at least equal to the low limit.wrap
- Indicates whether to support wrap around for the long range
type.
public LongType getLongType()
public NullType getNullType()
public PrimitiveExtType getPrimitiveExtType(String id, Type[] argTypes)
id
- The id of the ext type. Must be non-null.argTypes
- The arguments for type variables. Must be non-null. Each
element must be non-null.
public PrimitiveTypeExtensionType getPrimitiveTypeExtensionType(String id, String[] typeVarIds)
id
- The primitive extension type id. Must be non-null.typeVarIds
- The fixed type variable ids. Must be non-null. Each element
must be non-null. Each element must be distinct.
public RecordType getRecordType(String id)
id
- The id of the record type. Must be non-null.
public StringType getStringType()
public ThreadIdType getThreadIdType()
public TypeExtensionType getTypeExtensionType(String id, String[] typeVarIds)
id
- The extension type id. Must be non-null.typeVarIds
- The fixed type variable ids. Must be non-null. Each element
must be non-null. Each element must be distinct.
public Set<Type> getTypeSet()
public UnknownType getUnknownType()
public VoidType getVoidType()
public void dispose()
dispose
in interface Disposable
public TypeVar geTypeVar(String id)
id
- The id of the a type var. Must be non-null.
public Type instantiate(Type type, Map<String,Type> typeVarTypeTable)
type
- The type to be instantiated. Must be non-null.typeVarTypeTable
- The mapping from the type variables of the type to their type
counterpart. Must be non-null.
public void remove(Type type)
type
- The type to be removed.public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |