Class TypeVar

  • All Implemented Interfaces:
    Type

    public class TypeVar
    extends java.lang.Object
    implements Type
    Type variable (e.g. 'a).
    • Constructor Summary

      Constructors 
      Constructor Description
      TypeVar​(int ordinal)
      Creates a type variable with a given ordinal.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <R> R accept​(TypeVisitor<R> typeVisitor)  
      Type copy​(TypeSystem typeSystem, java.util.function.Function<Type,​Type> transform)
      Copies this type, applying a given transform to component types, and returning the original type if the component types are unchanged.
      java.lang.String description()
      Description of the type, e.g.
      Op op()
      Type operator.
      java.lang.String toString()
      Returns a string for debugging; see also description().
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • TypeVar

        public TypeVar​(int ordinal)
        Creates a type variable with a given ordinal.

        TypeVar.of(0) returns "'a"; TypeVar.of(1) returns "'b", etc.

    • Method Detail

      • toString

        public java.lang.String toString()
        Returns a string for debugging; see also description().
        Overrides:
        toString in class java.lang.Object
      • description

        public java.lang.String description()
        Description copied from interface: Type
        Description of the type, e.g. "int", "int -> int".
        Specified by:
        description in interface Type
      • op

        public Op op()
        Description copied from interface: Type
        Type operator.
        Specified by:
        op in interface Type
      • copy

        public Type copy​(TypeSystem typeSystem,
                         java.util.function.Function<Type,​Type> transform)
        Description copied from interface: Type
        Copies this type, applying a given transform to component types, and returning the original type if the component types are unchanged.
        Specified by:
        copy in interface Type