Class TypeTokenType

  • All Implemented Interfaces:
    Type

    public class TypeTokenType
    extends java.lang.Object
    implements Type
    The type of type tokens, used as reference to types in code.
    • Constructor Detail

      • TypeTokenType

        public TypeTokenType​(ExternalSet<Type> types)
        Builds the type token representing the given types.
        Parameters:
        types - the types
    • Method Detail

      • getTypes

        public ExternalSet<Type> getTypes()
        Yields the Types represented by this type token.
        Returns:
        the types
      • toString

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

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

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals 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