Package it.unive.lisa.type
Class NullType
- java.lang.Object
-
- it.unive.lisa.type.NullType
-
- All Implemented Interfaces:
PointerType,Type
public final class NullType extends java.lang.Object implements PointerType
The Null type, that is the type of {#link NullLiteral}. It implements the singleton design pattern, that is the instances of this type are unique. The unique instance of this type can be retrieved byINSTANCE. It implements the singleton design pattern, that is the instances of this type are unique. The unique instance of this type can be retrieved byINSTANCE.
-
-
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 other)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
-
-
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein 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
-
-