Package it.unive.lisa.symbolic.types
Class IntType
- java.lang.Object
-
- it.unive.lisa.symbolic.types.IntType
-
- All Implemented Interfaces:
NumericType,Type
public final class IntType extends java.lang.Object implements NumericType
An internal implementation of theNumericTypeinterface that can be used by domains that need a concrete instance for integer values.
-
-
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()booleanis16Bits()Returnstrueif this numeric type follows a 16-bits format representation.booleanis32Bits()Returnstrueif this numeric type follows a 32-bits format representation.booleanis64Bits()Returnstrueif this numeric type follows a 64-bits format representation.booleanis8Bits()Returnstrueif this numeric type follows a 8-bits format representation.booleanisIntegral()Returnstrueif this numeric type is integral, representing one of the numbers in the mathematical set Z.booleanisUnsigned()Returnstrueif this numeric type is unsigned.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.NumericType
isSigned
-
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 IntType 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
-
is8Bits
public boolean is8Bits()
Description copied from interface:NumericTypeReturnstrueif this numeric type follows a 8-bits format representation.- Specified by:
is8Bitsin interfaceNumericType- Returns:
trueif this numeric type follows a 8-bits format representation;falseotherwise
-
is16Bits
public boolean is16Bits()
Description copied from interface:NumericTypeReturnstrueif this numeric type follows a 16-bits format representation.- Specified by:
is16Bitsin interfaceNumericType- Returns:
trueif this numeric type follows a 16-bits format representation;falseotherwise
-
is32Bits
public boolean is32Bits()
Description copied from interface:NumericTypeReturnstrueif this numeric type follows a 32-bits format representation.- Specified by:
is32Bitsin interfaceNumericType- Returns:
trueif this numeric type follows a 32-bits format representation;falseotherwise
-
is64Bits
public boolean is64Bits()
Description copied from interface:NumericTypeReturnstrueif this numeric type follows a 64-bits format representation.- Specified by:
is64Bitsin interfaceNumericType- Returns:
trueif this numeric type follows a 64-bits format representation;falseotherwise
-
isUnsigned
public boolean isUnsigned()
Description copied from interface:NumericTypeReturnstrueif this numeric type is unsigned.- Specified by:
isUnsignedin interfaceNumericType- Returns:
trueif this numeric type is unsigned;falseotherwise
-
isIntegral
public boolean isIntegral()
Description copied from interface:NumericTypeReturnstrueif this numeric type is integral, representing one of the numbers in the mathematical set Z.- Specified by:
isIntegralin interfaceNumericType- Returns:
trueif this numeric type is integral;falseotherwise
-
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
-
-