Class ReadableStorage

java.lang.Object
com.pervasive.datarush.operators.group.ReadableStorage

public final class ReadableStorage extends Object
Storage class by which a custom aggregator can load 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 readable storage.
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    getBinaryRef(int offset)
    Returns the value of the internal element at the given offset.
    boolean
    getBoolean(int offset)
    Returns the value of the internal element at the given offset.
    char
    getChar(int offset)
    Returns the value of the internal element at the given offset.
    long
    getDateEpochDays(int offset)
    Returns the value of the internal element at the given offset.
    double
    getDouble(int offset)
    Returns the value of the internal element at the given offset.
    float
    getFloat(int offset)
    Returns the value of the internal element at the given offset.
    int
    getInt(int offset)
    Returns the value of the internal element at the given offset.
    long
    getLong(int offset)
    Returns the value of the internal element at the given offset.
    long
    getMoney(int offset)
    Returns the value of the internal element at the given offset.
    getNumeric(int offset)
    Returns the value of the internal element at the given offset.
    getObject(int offset)
    Returns the value of the internal element at the given offset.
    getScalarValued(int offset)
    Returns the value of the internal element at the given offset.
    getString(int offset)
    Returns the value of the internal element at the given offset.
    int
    getTimeDayMillis(int offset)
    Returns 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

    • ReadableStorage

      public ReadableStorage(ScalarValued[] internals)
      Create a new readable storage.
      Parameters:
      internals - the array of internals.
  • Method Details

    • getDouble

      public double getDouble(int offset)
      Returns the value of the internal element at the given offset.
      Parameters:
      offset - the offset of the internal element.
      Returns:
      the 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 DoubleValued
    • getNumeric

      public BigDecimal getNumeric(int offset)
      Returns the value of the internal element at the given offset.
      Parameters:
      offset - the offset of the internal element.
      Returns:
      the 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 NumericValued
    • getMoney

      public long getMoney(int offset)
      Returns the value of the internal element at the given offset.
      Parameters:
      offset - the offset of the internal element.
      Returns:
      the 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 MoneyValued
    • getLong

      public long getLong(int offset)
      Returns the value of the internal element at the given offset.
      Parameters:
      offset - the offset of the internal element.
      Returns:
      the 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 LongValued
    • getObject

      public Object getObject(int offset)
      Returns the value of the internal element at the given offset.
      Parameters:
      offset - the offset of the internal element.
      Returns:
      the 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 ObjectValued
    • getScalarValued

      public ScalarValued getScalarValued(int offset)
      Returns the value of the internal element at the given offset.
      Parameters:
      offset - the offset of the internal element.
      Returns:
      the value of the internal element at the given offset.
      Throws:
      ArrayIndexOutOfBoundsException - if the given offset is larger than the number of internalTypes.
    • getBinaryRef

      public byte[] getBinaryRef(int offset)
      Returns the value of the internal element at the given offset.
      Parameters:
      offset - the offset of the internal element.
      Returns:
      the 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 BinaryValued
    • getBoolean

      public boolean getBoolean(int offset)
      Returns the value of the internal element at the given offset.
      Parameters:
      offset - the offset of the internal element.
      Returns:
      the 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 BooleanValued.
    • getChar

      public char getChar(int offset)
      Returns the value of the internal element at the given offset.
      Parameters:
      offset - the offset of the internal element.
      Returns:
      the 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 CharValued.
    • getDateEpochDays

      public long getDateEpochDays(int offset)
      Returns the value of the internal element at the given offset.
      Parameters:
      offset - the offset of the internal element.
      Returns:
      the 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 DateValued.
    • getInt

      public int getInt(int offset)
      Returns the value of the internal element at the given offset.
      Parameters:
      offset - the offset of the internal element.
      Returns:
      the 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 IntValued.
    • getString

      public String getString(int offset)
      Returns the value of the internal element at the given offset.
      Parameters:
      offset - the offset of the internal element.
      Returns:
      the 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 StringValued.
    • getFloat

      public float getFloat(int offset)
      Returns the value of the internal element at the given offset.
      Parameters:
      offset - the offset of the internal element.
      Returns:
      the 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 FloatValued.
    • getTimeDayMillis

      public int getTimeDayMillis(int offset)
      Returns the value of the internal element at the given offset.
      Parameters:
      offset - the offset of the internal element.
      Returns:
      the 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 TimeValued.