Package net.hydromatic.morel.type
Class TypeVar
- java.lang.Object
-
- net.hydromatic.morel.type.TypeVar
-
-
Field Summary
Fields Modifier and Type Field Description private static char[]ALPHASprivate static com.google.common.cache.LoadingCache<java.lang.Integer,java.lang.String>NAME_CACHE(package private) intordinal
-
Constructor Summary
Constructors Constructor Description TypeVar(int ordinal)Creates a type variable with a given ordinal.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <R> Raccept(TypeVisitor<R> typeVisitor)Typecopy(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.Stringdescription()Description of the type, e.g.private static java.lang.Stringname(int i)Generates a name for a type variable.Opop()Type operator.java.lang.StringtoString()Returns a string for debugging; see alsodescription().
-
-
-
Method Detail
-
toString
public java.lang.String toString()
Returns a string for debugging; see alsodescription().- Overrides:
toStringin classjava.lang.Object
-
accept
public <R> R accept(TypeVisitor<R> typeVisitor)
-
name
private static java.lang.String name(int i)
Generates a name for a type variable.0 → 'a, 1 → 'b, 26 → 'z, 27 → 'ba, 28 → 'bb, 675 → 'zz, 676 → 'baa, etc. (Think of it is a base 26 number, with "a" as 0, "z" as 25.)
-
description
public java.lang.String description()
Description copied from interface:TypeDescription of the type, e.g. "int", "int -> int".- Specified by:
descriptionin interfaceType
-
copy
public Type copy(TypeSystem typeSystem, java.util.function.Function<Type,Type> transform)
Description copied from interface:TypeCopies this type, applying a given transform to component types, and returning the original type if the component types are unchanged.
-
-