public class TupleType extends ConstructedType
| Modifier and Type | Method and Description |
|---|---|
void |
checkOccurrence(TypeParameter parameter,
Type context,
TypeChecker typeChecker)
Throws a FailedUnificationException if the specified type parameter occurs
in this type.
|
Type |
component(int i) |
Type[] |
components() |
Type |
copy(java.util.HashMap parameters)
Returns a copy of this type with a consistent renaming of all free type
parameters, and identyfing bound type parameters with their values.
|
int |
dimension() |
int |
eqCode()
Returns a hash code for this type - the reason for using the name eqCode
(rather than overriding hashCode), is that it is important to preserve
the implementation of java.lang.Object.hashCode for type parameters (to
be compatible with ==).
|
Type |
flatten()
Returns a flattened form of this type by uncurrying all the domains of all
function types that occur in it.
|
java.util.HashSet |
getParameters(java.util.HashSet set)
Returns the specified set augmented with all the unbound type parameters that
occur in this type.
|
Type |
instantiate(java.util.HashMap substitution)
Returns a copy of this type with all free type parameters bound as per the
specified type substitution.
|
boolean |
isEqualTo(Type type)
Returns true iff this type is structurally isomorphic to the specified type.
|
boolean |
isEqualTo(Type type,
java.util.HashMap parameters)
Returns true iff this type is structurally isomorphic to the
specified type, under the renaming of type parameters specified
by the given HashMap.
|
byte |
kind()
This returns the value identifying what kind of type this is.
|
static TupleType |
newTupleType(java.util.AbstractList components) |
static TupleType |
newTupleType(Type[] components) |
int |
numberOfTypeComponents()
Returns the number of type components making up this 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.
|
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, copy, curry, equals, findValue, getParameters, getValue, INT, is, isBag, isBoolean, isBoxedType, isChar, isCollection, isGlobalUnsafe, isInt, isList, isPolymorphic, isPrimitive, isReal, isSet, isString, isVoid, kindString, rank, REAL, resetNames, setBoxed, shadowType, sort, standardize, toFullString, toQuantifiedString, toQuantifiedString, typeComponent, unwrapper, value, wrapperpublic static final TupleType EMPTY
public final int numberOfTypeComponents()
TypenumberOfTypeComponents in class Typepublic final Type typeRefComponent(int n) throws NoSuchTypeComponentException
TypetypeRefComponent in class TypeNoSuchTypeComponentExceptionpublic final void setTypeRefComponent(int n,
Type type)
throws NoSuchTypeComponentException
TypesetTypeRefComponent in class TypeNoSuchTypeComponentExceptionpublic static final TupleType newTupleType(java.util.AbstractList components)
public byte kind()
Typepublic final Type component(int i)
public final Type[] components()
public final int dimension()
public void unify(Type type, TypeChecker typeChecker) throws FailedUnificationException
Typeunify in class TypeFailedUnificationExceptionpublic boolean unify(Type type)
Typepublic final void checkOccurrence(TypeParameter parameter, Type context, TypeChecker typeChecker) throws FailedUnificationException
TypeN.B.: The following definition specifies only the default behavior for this method. Specific subclasses are generally expected to override this method.
checkOccurrence in class TypeFailedUnificationExceptionpublic final java.util.HashSet getParameters(java.util.HashSet set)
TypegetParameters in class Typepublic final Type flatten()
TypeN.B.: The following definition specifies only the default behavior for this method. Specific subclasses are generally expected to override this method.
public Type copy(java.util.HashMap parameters)
TypeN.B.: The following definition specifies only the default behavior for this method. Specific subclasses are generally expected to override this method.
public Type instantiate(java.util.HashMap substitution)
TypeN.B.: The following definition specifies only the default behavior for this method. Specific subclasses are generally expected to override this method.
instantiate in class Typepublic final int eqCode()
Typepublic boolean isEqualTo(Type type)
Typepublic boolean isEqualTo(Type type, java.util.HashMap parameters)
Typepublic java.lang.String toString()
toString in class java.lang.Object