Interface DataChunk

All Known Subinterfaces:
FloatingPointValuedDataChunk, IntegerValuedDataChunk
All Known Implementing Classes:
ByteChunk, DoubleChunk, FloatChunk, IntChunk, LongChunk, ShortChunk

public interface DataChunk
The DataChunk interface is implemented by concrete classes that hold data of a specific internal primitive type. The internal type may be different from the external type that the data values represent.
Since:
3.4.0
Author:
Peter Hollemans
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static enum 
    The enumeration of the possible chunk external data types.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Accepts a visitor in this chunk.
    Creates a blank copy of this data chunk.
    blankCopyWithValues(int values)
    Creates a blank copy of this data chunk with the specified number of data values.
    Gets the external data type that values in this chunk are meant to represent.
    Gets the primitive chunk data.
    int
    Gets the number of values held by this chunk.
    boolean
    Checks if this chunk is compatible with another.
    int
    Gets the number of bytes each value uses.
  • Method Details

    • getExternalType

      DataChunk.DataType getExternalType()
      Gets the external data type that values in this chunk are meant to represent. This is the type that the chunk unpacks to if values are packed.
      Returns:
      the external data type.
    • accept

      void accept(ChunkVisitor visitor)
      Accepts a visitor in this chunk.
      Parameters:
      visitor - the visitor to accept.
    • getValues

      int getValues()
      Gets the number of values held by this chunk.
      Returns:
      the number of values.
    • getPrimitiveData

      Object getPrimitiveData()
      Gets the primitive chunk data.
      Returns:
      the primitive data stored in this chunk.
    • blankCopy

      DataChunk blankCopy()
      Creates a blank copy of this data chunk.
      Returns:
      the new blank data chunk. The data values are uninitialized.
    • blankCopyWithValues

      DataChunk blankCopyWithValues(int values)
      Creates a blank copy of this data chunk with the specified number of data values.
      Parameters:
      values - the number of data values in the new blank data chunk.
      Returns:
      the new blank data chunk. The data values are uninitialized.
    • isCompatible

      boolean isCompatible(DataChunk chunk)
      Checks if this chunk is compatible with another. Compatible chunks share the same primitive data type and other properties.
      Parameters:
      chunk - the data chunk to check.
      Since:
      3.8.0
    • valueBytes

      int valueBytes()
      Gets the number of bytes each value uses.
      Returns:
      the bytes per data value in the primitive data.
      Since:
      3.8.1
      See Also: