Package gnu.mapping

Class Values<E>

    • Field Detail

      • noArgs

        public static final Object[] noArgs
      • empty

        public static final Values empty
    • Constructor Detail

      • Values

        protected Values()
    • Method Detail

      • getValues

        public Object[] getValues()
        Get the values encapsulated.
      • values2

        public static <E,​V1 extends E,​V2 extends E> Values.Values2<E,​V1,​V2> values2​(V1 val1,
                                                                                                            V2 val2)
      • make

        public static Values make()
      • make

        public static <E> Object make​(E[] vals)
        Create a value for each element of an array.
        Parameters:
        vals - values to use. The array should be immutable, as may be re-used for the result.
      • makeFromArray

        public static <E> Values<E> makeFromArray​(E... vals)
      • make

        public static <E> Object make​(List<E> seq)
        Create a value for each element of a list.
        Parameters:
        seq - values to use. The list should be immutable, as may be re-used for the result.
      • make

        public static Object make​(TreeList list,
                                  int startPosition,
                                  int endPosition)
        Extract a value (single or Values) from a sub-range of a TreeList.
        Parameters:
        list - the TreeList to copy
        startPosition - start of range, as a raw index in data
        endPosition - end of range, as a raw index in data
      • canonicalize

        public Object canonicalize()
        If a simple value, return that value. Also, if no values, return empty.
      • print

        public void print​(Consumer out)
      • incrPos

        public static int incrPos​(Object values,
                                  int pos)
      • getFromPos

        public static Object getFromPos​(Object values,
                                        int pos)
      • getFromPosFinal

        public static Object getFromPosFinal​(Object values,
                                             int pos)
      • checkFinalPos

        public static void checkFinalPos​(Object values,
                                         int pos)
      • nextIndex

        public static int nextIndex​(Object values,
                                    int curIndex)
        Helper method called by compiled code. The compiled code iterates through zero or more values. Return the index of the next value, or -1 if currently at eof. A non-Values object is treated as a singleton value, so in that case there is no next value.
      • nextValue

        public static Object nextValue​(Object values,
                                       int curIndex)
        Helper method called by compiled code. The compiled code iterates through zero or more values. Extract the object referenced by the curIndex. A non-Values object is treated as a singleton value.
      • nextIndex

        protected int nextIndex​(int ipos)
        Description copied from class: AbstractSequence
        Get the offset from the beginning corresponding to a position cookie.
        Overrides:
        nextIndex in class AbstractSequence<E>
      • writeValues

        public static void writeValues​(Object value,
                                       Consumer out)
      • countValues

        public static int countValues​(Object value)