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
The type of a tuple value.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classCache of the string representations of integers. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<R> Raccept(TypeVisitor<R> typeVisitor) argNames()Returns a list of field names.Returns a map of the field types, keyed by field names.argType(int i) Returns the type of theith field, or throws.argTypes()Returns a list of field types, ordered by field names.copy(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.key()Description of the type, e.gordinalNames(int size) Returns a list of strings ["1", ..., "size"].(package private) static <E> com.google.common.collect.ImmutableSortedMap<String, E> Given a list of types [t1, t2, ..., tn] returns a sorted map ["1" : t1, "2" : t2, ...booleanspecializes(Type type) Whether this type is the same as, or a specialization of, a given type.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.hydromatic.morel.type.RecordLikeType
asTypedValueMethods inherited from interface net.hydromatic.morel.type.Type
arg, canCallArgOf, isCollection, isFinite, isProgressive, moniker, op, substitute, unifyWith
-
Field Details
-
INT_STRING_CACHE
-
argTypes
-
-
Constructor Details
-
TupleType
-
-
Method Details
-
argNameTypes
Description copied from interface:RecordLikeTypeReturns a map of the field types, keyed by field names.- Specified by:
argNameTypesin interfaceRecordLikeType
-
argNames
Description copied from interface:RecordLikeTypeReturns a list of field names.- Specified by:
argNamesin interfaceRecordLikeType
-
argTypes
Description copied from interface:RecordLikeTypeReturns a list of field types, ordered by field names.- Specified by:
argTypesin interfaceRecordLikeType
-
argType
Description copied from interface:RecordLikeTypeReturns the type of theith field, or throws.- Specified by:
argTypein interfaceRecordLikeType
-
accept
-
key
Description copied from interface:TypeDescription of the type, e.g. "int", "int -> int", "NONE | SOME of 'a". -
copy
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. -
specializes
Description copied from interface:TypeWhether this type is the same as, or a specialization of, a given type.For example,
boolspecializesbooland'abut does not specializeintor('a, 'b).- Specified by:
specializesin interfaceType
-
ordinalNames
Returns a list of strings ["1", ..., "size"]. -
recordMap
static <E> com.google.common.collect.ImmutableSortedMap<String,E> recordMap(List<? extends E> argTypes) Given a list of types [t1, t2, ..., tn] returns a sorted map ["1" : t1, "2" : t2, ... "n" : tn].
-