public class TypeConstant extends NamedType
| Constructor and Description |
|---|
TypeConstant(java.lang.String name) |
TypeConstant(java.lang.String name,
byte sort) |
TypeConstant(java.lang.String name,
byte sort,
boolean isBoxedType) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isBoxedType()
This returns true iff this type has been marked as boxed
(true by default - overridden by
TypeConstant).
|
boolean |
isEqualTo(Type type)
Returns true iff this type constant and the specified type
are identical objects (i.e., same pointers).
|
boolean |
isEqualTo(Type type,
java.util.HashMap parameters)
Returns true iff this type constant and the specified type
are identical objects (i.e., same pointers).
|
byte |
kind()
This returns the value identifying what kind of type this is.
|
int |
numberOfTypeComponents()
Returns the number of type components making up this type.
|
void |
setShadowType(Type type) |
void |
setTypeRefComponent(int n,
Type type)
Sets the n-th undereferenced type component of this type to the specified type;
throws a NoSuchTypeComponentException otherwise.
|
Type |
shadowType()
This is used in Homomorphism
for typing irregular monoid operations in the absence of a real mechanism for subtyping.
|
byte |
sort()
This returns the runtime sort for this type (OBJECT_SORT
by default - overridden by TypeConstant).
|
java.lang.String |
toString() |
Type |
typeRefComponent(int n)
Returns the n-th undereferenced type component in this type, if any; throws a
NoSuchTypeComponentException otherwise.
|
boolean |
unify(Type type)
This unifies this type with the specified type with no possibility of undoing any
effects.
|
void |
unify(Type type,
TypeChecker typeChecker)
This unifies this type with the specified type in the context
of the specified TypeChecker.
|
actualType, array, array, baseType, baseTypeRef, BOOLEAN, BOXED_BOOLEAN, BOXED_CHAR, BOXED_INT, BOXED_REAL, boxSort, CHAR, checkOccurrence, copy, copy, curry, equals, findValue, flatten, getParameters, getParameters, getValue, instantiate, INT, is, isBag, isBoolean, isChar, isCollection, isGlobalUnsafe, isInt, isList, isPolymorphic, isPrimitive, isReal, isSet, isString, isVoid, kindString, rank, REAL, resetNames, setBoxed, standardize, toFullString, toQuantifiedString, toQuantifiedString, typeComponent, unwrapper, value, wrapperpublic TypeConstant(java.lang.String name)
public TypeConstant(java.lang.String name,
byte sort)
public TypeConstant(java.lang.String name,
byte sort,
boolean isBoxedType)
public final Type shadowType()
TypeshadowType in class Typepublic final void setShadowType(Type type)
public int numberOfTypeComponents()
TypenumberOfTypeComponents in class Typepublic Type typeRefComponent(int n) throws NoSuchTypeComponentException
TypetypeRefComponent in class TypeNoSuchTypeComponentExceptionpublic void setTypeRefComponent(int n,
Type type)
throws NoSuchTypeComponentException
TypesetTypeRefComponent in class TypeNoSuchTypeComponentExceptionpublic byte kind()
Typepublic final byte sort()
TypeN.B.: The following definition specifies only the default behavior for this method. Specific subclasses are generally expected to override this method.
public final boolean isBoxedType()
TypeN.B.: The following definition specifies only the default behavior for this method. Specific subclasses are generally expected to override this method.
isBoxedType in class Typepublic void unify(Type type, TypeChecker typeChecker) throws FailedUnificationException
Typeunify in class TypeFailedUnificationExceptionpublic boolean unify(Type type)
Typepublic final boolean isEqualTo(Type type)
public final boolean isEqualTo(Type type, java.util.HashMap parameters)