Package com.qfs.chunk

Interface IChunkLong

All Superinterfaces:
IArray, IArrayReader, IArrayWriter, IChunk<Long>, IMemoryMonitored, IWritableArray
All Known Subinterfaces:
IConcurrentChunkLong
All Known Implementing Classes:
ArrayChunkLong, ArrayChunkLongNullable, BufferChunkLong, BufferChunkLongNullable, ChunkOffsetLong, ChunkSingleLong, DirectChunkLong, DirectChunkLongNullable, FrequentLongChunk, FrequentNullLongChunk, NullableFrequentLongChunk, WrapperChunkInteger

public interface IChunkLong extends IChunk<Long>
Specialized chunk that stores long primitive data.

Specialized primitive read operations access the physical storage directly and ignore null checks, so when dealing with implementations that support null values, the IArrayReader.isNull(int) method must be called before reading the value.

Implementations must override the readLong(int) and writeLong(int, long) methods that are used in all default implementations within this interface.

Author:
ActiveViam
  • Method Details

    • isPrimitive

      default boolean isPrimitive()
      Description copied from interface: IChunk
      Returns whether this chunk contains primitive data, as per Types.isPrimitive(int).
      Specified by:
      isPrimitive in interface IChunk<Long>
      Returns:
      true if this chunk contains primitive data, as per Types.isPrimitive(int), false otherwise
    • getBindingType

      default int getBindingType()
      Description copied from interface: IChunk
      Gets the type for binding transfers of this chunk.
      Specified by:
      getBindingType in interface IChunk<Long>
      Returns:
      the physical type like Types.PHYSICAL_INT, etc
    • writeFromCell

      default void writeFromCell(int position, IReadableCell cell)
      Description copied from interface: IChunk
      Writes the content of the cell into the chunk at the given position.

      It is up to chunks to use the appropriate read method to avoid boxing as much as possible.

      Specified by:
      writeFromCell in interface IChunk<Long>
    • fill

      default void fill(long value)
      Fills the entire column with the same value.
      Parameters:
      value - the value to fill the chunk with
    • equals

      boolean equals(int position, long value)
      Tests if the record stored at that position is equal to a value.
      Parameters:
      position - the position to read
      value - the value to compare
      Returns:
      true if the read value is the same as the given value, false otherwise
    • read

      Long read(int position)
      Description copied from interface: IChunk
      Returns the data stored at that position in the chunk.
      Specified by:
      read in interface IArrayReader
      Specified by:
      read in interface IChunk<Long>
      Parameters:
      position - the position in the chunk at which to read
      Returns:
      the data stored at that position in the chunk
    • readLong

      long readLong(int position)
      Description copied from interface: IArrayReader
      Reads a long primitive value from the array.

      An exception is thrown if the value is not of the right type.

      Specified by:
      readLong in interface IArrayReader
      Parameters:
      position - 0-based index in an array
      Returns:
      long value
    • readFloat

      float readFloat(int position)
      Description copied from interface: IArrayReader
      Reads a float primitive value from the array.

      An exception is thrown if the value is not of the right type.

      Specified by:
      readFloat in interface IArrayReader
      Parameters:
      position - 0-based index in an array
      Returns:
      float value
    • readDouble

      double readDouble(int position)
      Description copied from interface: IArrayReader
      Reads a double primitive value from the array.

      An exception is thrown if the value is not of the right type.

      Specified by:
      readDouble in interface IArrayReader
      Parameters:
      position - 0-based index in an array
      Returns:
      double value
    • write

      void write(int position, Object value)
      Description copied from interface: IArrayWriter
      Writes a piece of data at a position in the array.

      For better performance, use the primitive type operations.

      Specified by:
      write in interface IArrayWriter
      Parameters:
      position - 0-based index in the array
      value - the value to write
    • writeInt

      void writeInt(int position, int value)
      Description copied from interface: IArrayWriter
      Writes an int primitive value in the array.
      Specified by:
      writeInt in interface IArrayWriter
      Parameters:
      position - 0-based index in the array
      value - the value to write
    • writeLong

      void writeLong(int position, long value)
      Description copied from interface: IArrayWriter
      Writes a long primitive value in the array.
      Specified by:
      writeLong in interface IArrayWriter
      Parameters:
      position - 0-based index in the array
      value - the value to write
    • copyInto

      default void copyInto(int position, IWritableCell cell)
      Description copied from interface: IChunk
      Copies the value at a given position in this chunk into the provided cell.
      Specified by:
      copyInto in interface IChunk<Long>
      Parameters:
      position - row of the chunk to read
    • transfer

      default void transfer(IWritableTable destination, int destinationColumn, int[] rowsMapping, int numRows)
      Description copied from interface: IChunk
      Transfers a given number of rows from this chunk to target rows in the given column of the destination table.

      The mapping from the source rows to the target rows is described with an array of 2*n slots. Each even slot contains the index of the row to be copied from the source chunk and the following odd slot contains the index of the row into which the source data will be transferred.

      Specified by:
      transfer in interface IChunk<Long>
      Parameters:
      destination - the destination table
      destinationColumn - the column to transfer the data to in the destination table
      rowsMapping - the mapping from source rows to target rows, as explained above
      numRows - the number of rows to transfer
    • createFrequentValueChunk

      default IFrequentValueChunk<Long> createFrequentValueChunk(int chunkSize, Long frequentValue, IChunk<Long> underlyingChunk, IRowMapping mapping, boolean hasNullValues)
      Description copied from interface: IChunk
      Creates a compressed version of this chunk using frequency compression.
      Specified by:
      createFrequentValueChunk in interface IChunk<Long>
      Parameters:
      chunkSize - visible size of the compressed chunk
      underlyingChunk - underlying chunk containing values different from the frequent value
      mapping - mapping liking visible rows to each non-frequent value
      hasNullValues - flag indicating if the underlying chunk contains null values.
      See Also: