Class 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.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      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.
      BigDecimal getNumeric​(int offset)
      Returns the value of the internal element at the given offset.
      Object getObject​(int offset)
      Returns the value of the internal element at the given offset.
      ScalarValued getScalarValued​(int offset)
      Returns the value of the internal element at the given offset.
      String 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.
    • Constructor Detail

      • ReadableStorage

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

      • 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
      • 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
      • 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.
      • 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.