Class BoolType

  • All Implemented Interfaces:
    BooleanType, Type

    public final class BoolType
    extends java.lang.Object
    implements BooleanType
    An internal implementation of the BooleanType interface that can be used by domains that need a concrete instance of that interface.
    • 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: 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
      • 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