Class WriteableStorage

java.lang.Object
com.pervasive.datarush.operators.group.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.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create a new writeable storage.
  • Method Summary

    Modifier and Type
    Method
    Description
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • WriteableStorage

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

    • setObject

      public void setObject(int offset, Object 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 ObjectSettable
    • 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
    • setNumeric

      public void setNumeric(int offset, BigDecimal 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 NumericSettable
    • 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
    • setString

      public void setString(int offset, String 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 StringSettable
    • 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