Class IntType

  • All Implemented Interfaces:
    NumericType, Type

    public final class IntType
    extends java.lang.Object
    implements NumericType
    An internal implementation of the NumericType interface that can be used by domains that need a concrete instance for integer values.
    • 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: Type
        Determines if the type represented by this Type object is either the same as, or is a subtype of, the type represented by other. It returns true if so, and returns false otherwise.
        Specified by:
        canBeAssignedTo in interface Type
        Parameters:
        other - the other type
        Returns:
        true if that condition holds
      • commonSupertype

        public Type commonSupertype​(Type other)
        Description copied from interface: Type
        Yields the most specific common supertype between this Type and the given one. If no common supertype exists, this method returns Untyped.INSTANCE.
        Specified by:
        commonSupertype in interface Type
        Parameters:
        other - the other type
        Returns:
        the most specific common supertype between this and other
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • is8Bits

        public boolean is8Bits()
        Description copied from interface: NumericType
        Returns true if this numeric type follows a 8-bits format representation.
        Specified by:
        is8Bits in interface NumericType
        Returns:
        true if this numeric type follows a 8-bits format representation; false otherwise
      • is16Bits

        public boolean is16Bits()
        Description copied from interface: NumericType
        Returns true if this numeric type follows a 16-bits format representation.
        Specified by:
        is16Bits in interface NumericType
        Returns:
        true if this numeric type follows a 16-bits format representation; false otherwise
      • is32Bits

        public boolean is32Bits()
        Description copied from interface: NumericType
        Returns true if this numeric type follows a 32-bits format representation.
        Specified by:
        is32Bits in interface NumericType
        Returns:
        true if this numeric type follows a 32-bits format representation; false otherwise
      • is64Bits

        public boolean is64Bits()
        Description copied from interface: NumericType
        Returns true if this numeric type follows a 64-bits format representation.
        Specified by:
        is64Bits in interface NumericType
        Returns:
        true if this numeric type follows a 64-bits format representation; false otherwise
      • isUnsigned

        public boolean isUnsigned()
        Description copied from interface: NumericType
        Returns true if this numeric type is unsigned.
        Specified by:
        isUnsigned in interface NumericType
        Returns:
        true if this numeric type is unsigned; false otherwise
      • isIntegral

        public boolean isIntegral()
        Description copied from interface: NumericType
        Returns true if this numeric type is integral, representing one of the numbers in the mathematical set Z.
        Specified by:
        isIntegral in interface NumericType
        Returns:
        true if this numeric type is integral; false otherwise
      • allInstances

        public java.util.Collection<Type> allInstances()
        Description copied from interface: Type
        Yields all possible instances of this type, including itself.
        Specified by:
        allInstances in interface Type
        Returns:
        the possible instances