Class WriteableStorage


  • public final class WriteableStorage
    extends Object
    Storage class by which a custom aggregator can storage its internals. An aggregator's internals correspond element-by-element with the internalTypes that the aggregator declared. Needed only for writing custom Aggregator; consumers of the API should not need to use this class.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      ScalarSettable getScalarSettable​(int offset)
      Gets a mutable handle to the internal element at the given offset.
      void setBinaryRef​(int offset, byte[] value)
      Sets the value of the internal element at the given offset.
      void setBoolean​(int offset, boolean value)
      Sets the value of the internal element at the given offset.
      void setChar​(int offset, char value)
      Sets the value of the internal element at the given offset.
      void setDateEpochDays​(int offset, long value)
      Sets the value of the internal element at the given offset.
      void setDouble​(int offset, double value)
      Sets the value of the internal element at the given offset.
      void setFloat​(int offset, float value)
      Sets the value of the internal element at the given offset.
      void setInt​(int offset, int value)
      Sets the value of the internal element at the given offset.
      void setLong​(int offset, long value)
      Sets the value of the internal element at the given offset.
      void setMoney​(int offset, long value)
      Sets the value of the internal element at the given offset.
      void setNumeric​(int offset, BigDecimal value)
      Sets the value of the internal element at the given offset.
      void setObject​(int offset, Object value)
      Sets the value of the internal element at the given offset.
      void setString​(int offset, String value)
      Sets the value of the internal element at the given offset.
      void setTimeDayMillis​(int offset, int value)
      Sets the value of the internal element at the given offset.
      void setTimestamp​(int offset, long seconds, int nanos, int offsetSeconds)
      Sets the value of the internal element at the given offset.
    • Constructor Detail

      • WriteableStorage

        public WriteableStorage​(ScalarSettable[] internals)
        Create a new writeable storage.
        Parameters:
        internals - the array of internals.
    • Method Detail

      • setDouble

        public void setDouble​(int offset,
                              double value)
        Sets the value of the internal element at the given offset.
        Parameters:
        offset - the offset of the internal element.
        value - the new value of the internal element at the given offset.
        Throws:
        ArrayIndexOutOfBoundsException - if the given offset is larger than the number of internalTypes.
        ClassCastException - if the internalType at the given offset is not of type DoubleSettable
      • setMoney

        public void setMoney​(int offset,
                             long value)
        Sets the value of the internal element at the given offset.
        Parameters:
        offset - the offset of the internal element.
        value - the new value of the internal element at the given offset.
        Throws:
        ArrayIndexOutOfBoundsException - if the given offset is larger than the number of internalTypes.
        ClassCastException - if the internalType at the given offset is not of type LongSettable
      • setLong

        public void setLong​(int offset,
                            long value)
        Sets the value of the internal element at the given offset.
        Parameters:
        offset - the offset of the internal element.
        value - the new value of the internal element at the given offset.
        Throws:
        ArrayIndexOutOfBoundsException - if the given offset is larger than the number of internalTypes.
        ClassCastException - if the internalType at the given offset is not of type LongSettable
      • getScalarSettable

        public ScalarSettable getScalarSettable​(int offset)
        Gets a mutable handle to the internal element at the given offset.
        Parameters:
        offset - the offset of the internal element.
        Returns:
        a handle that can be used to mutate the internal value at the given offset
        Throws:
        ArrayIndexOutOfBoundsException - if the given offset is larger than the number of internalTypes.
      • setBinaryRef

        public void setBinaryRef​(int offset,
                                 byte[] value)
        Sets the value of the internal element at the given offset.
        Parameters:
        offset - the offset of the internal element.
        value - the new value of the internal element at the given offset.
        Throws:
        ArrayIndexOutOfBoundsException - if the given offset is larger than the number of internalTypes.
        ClassCastException - if the internalType at the given offset is not of type BinarySettable
      • setBoolean

        public void setBoolean​(int offset,
                               boolean value)
        Sets the value of the internal element at the given offset.
        Parameters:
        offset - the offset of the internal element.
        value - the new value of the internal element at the given offset.
        Throws:
        ArrayIndexOutOfBoundsException - if the given offset is larger than the number of internalTypes.
        ClassCastException - if the internalType at the given offset is not of type BooleanSettable
      • setChar

        public void setChar​(int offset,
                            char value)
        Sets the value of the internal element at the given offset.
        Parameters:
        offset - the offset of the internal element.
        value - the new value of the internal element at the given offset.
        Throws:
        ArrayIndexOutOfBoundsException - if the given offset is larger than the number of internalTypes.
        ClassCastException - if the internalType at the given offset is not of type CharSettable
      • setDateEpochDays

        public void setDateEpochDays​(int offset,
                                     long value)
        Sets the value of the internal element at the given offset.
        Parameters:
        offset - the offset of the internal element.
        value - the new value of the internal element at the given offset.
        Throws:
        ArrayIndexOutOfBoundsException - if the given offset is larger than the number of internalTypes.
        ClassCastException - if the internalType at the given offset is not of type DateSettable
      • setInt

        public void setInt​(int offset,
                           int value)
        Sets the value of the internal element at the given offset.
        Parameters:
        offset - the offset of the internal element.
        value - the new value of the internal element at the given offset.
        Throws:
        ArrayIndexOutOfBoundsException - if the given offset is larger than the number of internalTypes.
        ClassCastException - if the internalType at the given offset is not of type IntSettable
      • setTimeDayMillis

        public void setTimeDayMillis​(int offset,
                                     int value)
        Sets the value of the internal element at the given offset.
        Parameters:
        offset - the offset of the internal element.
        value - the new value of the internal element at the given offset.
        Throws:
        ArrayIndexOutOfBoundsException - if the given offset is larger than the number of internalTypes.
        ClassCastException - if the internalType at the given offset is not of type TimeSettable
      • setTimestamp

        public void setTimestamp​(int offset,
                                 long seconds,
                                 int nanos,
                                 int offsetSeconds)
        Sets the value of the internal element at the given offset.
        Parameters:
        offset - the offset of the internal element.
        seconds - number of seconds since Java epoch
        nanos - fractional portion of epoch time in nanoseconds
        offsetSeconds - time zone and daylight saving time offset, in seconds
        Throws:
        ArrayIndexOutOfBoundsException - if the given offset is larger than the number of internalTypes.
        ClassCastException - if the internalType at the given offset is not of type TimestampSettable
      • setFloat

        public void setFloat​(int offset,
                             float value)
        Sets the value of the internal element at the given offset.
        Parameters:
        offset - the offset of the internal element.
        value - the new value of the internal element at the given offset.
        Throws:
        ArrayIndexOutOfBoundsException - if the given offset is larger than the number of internalTypes.
        ClassCastException - if the internalType at the given offset is not of type FloatSettable