Package it.unive.lisa.symbolic.types
Class BoolType
- java.lang.Object
-
- it.unive.lisa.symbolic.types.BoolType
-
- All Implemented Interfaces:
BooleanType,Type
public final class BoolType extends java.lang.Object implements BooleanType
An internal implementation of theBooleanTypeinterface that can be used by domains that need a concrete instance of that interface.
-
-
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
-
-
-
-
Field Detail
-
INSTANCE
public static final BoolType INSTANCE
The singleton instance of this class.
-
-
Method Detail
-
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
-
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
-
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
-
-