Class RecordType

    • Field Detail

      • ORDERING

        public static final com.google.common.collect.Ordering<String> 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 Detail

      • RecordType

        RecordType​(com.google.common.collect.ImmutableSortedMap<String,​Type> argNameTypes)
    • Method Detail

      • key

        public Type.Key key()
        Description copied from interface: Type
        Description of the type, e.g. "int", "int -> int", "NONE | SOME of 'a".
        Specified by:
        key in interface Type
      • copy

        public RecordType copy​(TypeSystem typeSystem,
                               UnaryOperator<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
      • parseInt

        private static int parseInt​(String s)
        Parses a string that contains an integer value; returns Integer.MAX_VALUE if 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.

      • lookupField

        public Ord<Type> lookupField​(String fieldName)
        Returns the index of a given field, or -1.