Class VoidType

  • All Implemented Interfaces:
    Type

    public final class VoidType
    extends java.lang.Object
    implements Type
    The void type. It implements the singleton design pattern, that is the instances of this type are unique. The unique instance of this type can be retrieved by INSTANCE.
    • Field Detail

    • Method Detail

      • 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
      • 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
      • 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