Package it.unive.lisa.type
Class TypeTokenType
- java.lang.Object
-
- it.unive.lisa.type.TypeTokenType
-
-
Constructor Summary
Constructors Constructor Description TypeTokenType(ExternalSet<Type> types)Builds the type token representing the given types.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Collection<Type>allInstances()Yields all possible instances of this type, including itself.booleancanBeAssignedTo(Type other)Determines if the type represented by thisTypeobject is either the same as, or is a subtype of, the type represented byother.TypecommonSupertype(Type other)Yields the most specific common supertype between thisTypeand the given one.booleanequals(java.lang.Object obj)ExternalSet<Type>getTypes()Yields theTypes represented by this type token.inthashCode()java.lang.StringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface it.unive.lisa.type.Type
asArrayType, asBooleanType, asNullType, asNumericType, asPointerType, asStringType, asTypeTokenType, asUnitType, asUntyped, asVoidType, isArrayType, isBooleanType, isNullType, isNumericType, isPointerType, isStringType, isTypeTokenType, isUnitType, isUntyped, isVoidType
-
-
-
-
Constructor Detail
-
TypeTokenType
public TypeTokenType(ExternalSet<Type> types)
Builds the type token representing the given types.- Parameters:
types- the types
-
-
Method Detail
-
getTypes
public ExternalSet<Type> getTypes()
Yields theTypes represented by this type token.- Returns:
- the types
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
canBeAssignedTo
public boolean canBeAssignedTo(Type other)
Description copied from interface:TypeDetermines if the type represented by thisTypeobject is either the same as, or is a subtype of, the type represented byother. It returnstrueif so, and returnsfalseotherwise.- Specified by:
canBeAssignedToin interfaceType- Parameters:
other- the other type- Returns:
trueif that condition holds
-
commonSupertype
public Type commonSupertype(Type other)
Description copied from interface:TypeYields the most specific common supertype between thisTypeand the given one. If no common supertype exists, this method returnsUntyped.INSTANCE.- Specified by:
commonSupertypein interfaceType- Parameters:
other- the other type- Returns:
- the most specific common supertype between
thisandother
-
allInstances
public java.util.Collection<Type> allInstances()
Description copied from interface:TypeYields all possible instances of this type, including itself.- Specified by:
allInstancesin interfaceType- Returns:
- the possible instances
-
-