Class Formula

java.lang.Object
com.illumon.iris.db.v2.select.Formula
All Implemented Interfaces:
ElementSource
Direct Known Subclasses:
FormulaKernelAdapter

public abstract class Formula extends Object implements ElementSource
The Formula class is used within a FormulaColumn to compute individual table cell values.
  • Field Details

    • __index

      protected final Index __index
  • Constructor Details

    • Formula

      protected Formula(Index __index)
  • Method Details

    • getIndex

      public Index getIndex()
    • getPrev

      public abstract Object getPrev(long key)
      Description copied from interface: ElementSource
      Get the previous value at the index. Previous values are used during an LTM update cycle to process changes in data. During normal operation previous values will be identical to current values.
      Specified by:
      getPrev in interface ElementSource
      Parameters:
      key - the location in index space to get the value from.
      Returns:
      the previous value at the index, or null.
    • get

      public abstract Object get(long key)
      Description copied from interface: ElementSource
      Get the value from the source. This may return boxed values for basic types.
      Specified by:
      get in interface ElementSource
      Parameters:
      key - the location in index space to get the value from.
      Returns:
      the value at the index, potentially null.
    • getBoolean

      public Boolean getBoolean(long key)
      Description copied from interface: ElementSource
      Get the value at the index as a Boolean.
      Specified by:
      getBoolean in interface ElementSource
      Parameters:
      key - the location in index space to get the value from.
      Returns:
      the boolean at the index, potentially null.
    • getByte

      public byte getByte(long key)
      Description copied from interface: ElementSource
      Get the value at the index as a byte.
      Specified by:
      getByte in interface ElementSource
      Parameters:
      key - the location in index space to get the value from.
      Returns:
      the boolean at the index, null values are represented by QueryConstants.NULL_BYTE
    • getChar

      public char getChar(long key)
      Description copied from interface: ElementSource
      Get the value at the index as a char.
      Specified by:
      getChar in interface ElementSource
      Parameters:
      key - the location in index space to get the value from.
      Returns:
      the char at the index, null values are represented by QueryConstants.NULL_CHAR
    • getDouble

      public double getDouble(long key)
      Description copied from interface: ElementSource
      Get the value at the index as a double.
      Specified by:
      getDouble in interface ElementSource
      Parameters:
      key - the location in index space to get the value from.
      Returns:
      the double at the index, null values are represented by QueryConstants.NULL_DOUBLE
    • getFloat

      public float getFloat(long key)
      Description copied from interface: ElementSource
      Get the value at the index as a float.
      Specified by:
      getFloat in interface ElementSource
      Parameters:
      key - the location in index space to get the value from.
      Returns:
      the float at the index, null values are represented by QueryConstants.NULL_FLOAT
    • getInt

      public int getInt(long key)
      Description copied from interface: ElementSource
      Get the value at the index as an int.
      Specified by:
      getInt in interface ElementSource
      Parameters:
      key - the location in index space to get the value from.
      Returns:
      the int at the index, null values are represented by QueryConstants.NULL_INT
    • getLong

      public long getLong(long key)
      Description copied from interface: ElementSource
      Get the value at the index as a long.
      Specified by:
      getLong in interface ElementSource
      Parameters:
      key - the location in index space to get the value from.
      Returns:
      the long at the index, null values are represented by QueryConstants.NULL_LONG
    • getShort

      public short getShort(long key)
      Description copied from interface: ElementSource
      Get the value at the index as a short.
      Specified by:
      getShort in interface ElementSource
      Parameters:
      key - the location in index space to get the value from.
      Returns:
      the short at the index, null values are represented by QueryConstants.NULL_SHORT
    • getPrevBoolean

      public Boolean getPrevBoolean(long key)
      Description copied from interface: ElementSource
      Get the previous value at the index as a Boolean. See ElementSource.getPrev(long) for more details.
      Specified by:
      getPrevBoolean in interface ElementSource
      Parameters:
      key - the location in index space to get the previous value from.
      Returns:
      the previous boolean at the index, or null.
    • getPrevByte

      public byte getPrevByte(long key)
      Description copied from interface: ElementSource
      Get the previous value at the index as a byte. See ElementSource.getPrev(long) for more details.
      Specified by:
      getPrevByte in interface ElementSource
      Parameters:
      key - the location in index space to get the previous value from.
      Returns:
      the previous boolean at the index, null values are represented by QueryConstants.NULL_BYTE
    • getPrevChar

      public char getPrevChar(long key)
      Description copied from interface: ElementSource
      Get the previous value at the index as a char. See ElementSource.getPrev(long) for more details.
      Specified by:
      getPrevChar in interface ElementSource
      Parameters:
      key - the location in index space to get the previous value from.
      Returns:
      the previous char at the index, null values are represented by QueryConstants.NULL_CHAR
    • getPrevDouble

      public double getPrevDouble(long key)
      Description copied from interface: ElementSource
      Get the previous value at the index as a double. See ElementSource.getPrev(long) for more details.
      Specified by:
      getPrevDouble in interface ElementSource
      Parameters:
      key - the location in index space to get the previous value from.
      Returns:
      the previous double at the index, null values are represented by QueryConstants.NULL_DOUBLE
    • getPrevFloat

      public float getPrevFloat(long key)
      Description copied from interface: ElementSource
      Get the previous value at the index as a float. See ElementSource.getPrev(long) for more details.
      Specified by:
      getPrevFloat in interface ElementSource
      Parameters:
      key - the location in index space to get the previous value from.
      Returns:
      the previous float at the index, null values are represented by QueryConstants.NULL_FLOAT
    • getPrevInt

      public int getPrevInt(long key)
      Description copied from interface: ElementSource
      Get the previous value at the index as an int. See ElementSource.getPrev(long) for more details.
      Specified by:
      getPrevInt in interface ElementSource
      Parameters:
      key - the location in index space to get the previous value from.
      Returns:
      the previous int at the index, null values are represented by QueryConstants.NULL_INT
    • getPrevLong

      public long getPrevLong(long key)
      Description copied from interface: ElementSource
      Get the previous value at the index as a long. See ElementSource.getPrev(long) for more details.
      Specified by:
      getPrevLong in interface ElementSource
      Parameters:
      key - the location in index space to get the previous value from.
      Returns:
      the previous long at the index, null values are represented by QueryConstants.NULL_LONG
    • getPrevShort

      public short getPrevShort(long key)
      Description copied from interface: ElementSource
      Get the previous value at the index as a short. See ElementSource.getPrev(long) for more details.
      Specified by:
      getPrevShort in interface ElementSource
      Parameters:
      key - the location in index space to get the previous value from.
      Returns:
      the previous short at the index, null values are represented by QueryConstants.NULL_SHORT
    • makeGetContext

      public Formula.GetContext makeGetContext(int chunkCapacity)
    • makeFillContext

      public abstract Formula.FillContext makeFillContext(int chunkCapacity)
    • getChunk

      public Chunk<Attributes.Values> getChunk(@NotNull Formula.GetContext context, @NotNull OrderedKeys orderedKeys)
    • getPrevChunk

      public Chunk<Attributes.Values> getPrevChunk(@NotNull Formula.GetContext context, @NotNull OrderedKeys orderedKeys)
    • fillChunk

      public abstract void fillChunk(@NotNull Formula.FillContext context, @NotNull WritableChunk<? super Attributes.Values> destination, @NotNull OrderedKeys orderedKeys)
    • fillPrevChunk

      public abstract void fillPrevChunk(@NotNull Formula.FillContext context, @NotNull WritableChunk<? super Attributes.Values> destination, @NotNull OrderedKeys orderedKeys)
    • getChunkType

      protected abstract ChunkType getChunkType()