Package net.hydromatic.morel.type
Class RecordType
java.lang.Object
net.hydromatic.morel.type.BaseType
net.hydromatic.morel.type.RecordType
- All Implemented Interfaces:
RecordLikeType,Type
- Direct Known Subclasses:
ProgressiveRecordType
Record type.
-
Nested Class Summary
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.google.common.collect.Ordering<String> Ordering that compares integer values numerically, string values lexicographically, and integer values before string values. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<R> Raccept(TypeVisitor<R> typeVisitor) argType(int i) Returns the type of theith field, or throws.static intcompareNames(String o1, String o2) Helper forORDERING.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.g.private static intParses a string that contains an integer value; returnsInteger.MAX_VALUEif the string does not contain an integer, or if the value is less than zero, or if the value is greater than or equal to 1 billion.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.hydromatic.morel.type.RecordLikeType
asTypedValueMethods inherited from interface net.hydromatic.morel.type.Type
isProgressive, moniker, op, substitute
-
Field Details
-
argNameTypes
-
ORDERING
Ordering that compares integer values numerically, string values lexicographically, and integer values before string values.Thus: 2, 22, 202, a, a2, a202, a22.
-
-
Constructor Details
-
RecordType
-
-
Method Details
-
argNameTypes
- Specified by:
argNameTypesin 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. -
compareNames
Helper forORDERING. -
parseInt
Parses a string that contains an integer value; returnsInteger.MAX_VALUEif the string does not contain an integer, or if the value is less than zero, or if the value is greater than or equal to 1 billion.This approach is much faster for our purposes than
Integer.parseInt(String), which has to create and throw an exception if the value is not an integer.
-