Package net.hydromatic.morel.type
Class TupleType
- java.lang.Object
-
- net.hydromatic.morel.type.BaseType
-
- net.hydromatic.morel.type.TupleType
-
- All Implemented Interfaces:
RecordLikeType,Type
public class TupleType extends BaseType implements RecordLikeType
The type of a tuple value.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <R> Raccept(TypeVisitor<R> typeVisitor)SortedMap<String,Type>argNameTypes()TypeargType(int i)Returns the type of theith field, or throws.TupleTypecopy(TypeSystem typeSystem, UnaryOperator<Type> transform)Copies this type, applying a given transform to component types, and returning the original type if the component types are unchanged.Type.Keykey()Description of the type, e.g.static List<String>ordinalNames(int size)Returns a list of strings ["1", ..., "size"].private static Stringstr(int i)Converts an integer to its string representation, using a cached value if possible.(package private) static com.google.common.collect.ImmutableSortedMap<String,Type>toArgNameTypes(List<? extends Type> argTypes)Given a list of types [t1, t2, ..., tn] returns a sorted map ["1" : t1, "2" : t2, ...-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.hydromatic.morel.type.Type
moniker, op, substitute
-
-
-
-
Constructor Detail
-
TupleType
TupleType(com.google.common.collect.ImmutableList<Type> argTypes)
-
-
Method Detail
-
argNameTypes
public SortedMap<String,Type> argNameTypes()
- Specified by:
argNameTypesin interfaceRecordLikeType
-
argType
public Type argType(int i)
Description copied from interface:RecordLikeTypeReturns the type of theith field, or throws.- Specified by:
argTypein interfaceRecordLikeType
-
accept
public <R> R accept(TypeVisitor<R> typeVisitor)
-
key
public Type.Key key()
Description copied from interface:TypeDescription of the type, e.g. "int", "int -> int", "NONE | SOME of 'a".
-
copy
public TupleType copy(TypeSystem typeSystem, UnaryOperator<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.
-
str
private static String str(int i)
Converts an integer to its string representation, using a cached value if possible.
-
ordinalNames
public static List<String> ordinalNames(int size)
Returns a list of strings ["1", ..., "size"].
-
-