Package org.vast.data

Class DataBlockCompressed

java.lang.Object
org.vast.data.AbstractDataBlock
org.vast.data.DataBlockCompressed
All Implemented Interfaces:
Serializable, DataBlock

public class DataBlockCompressed extends AbstractDataBlock

Carries data in compressed format. Data is uncompressed on the fly when one of the get methods is called, and set Methods are not implemented.
All data is casted to the correct types when requested.

Since:
Jan 10, 2015
See Also:
  • Field Details

    • compressedData

      protected byte[] compressedData
    • uncompressedData

      protected DataBlock uncompressedData
    • compressionType

      protected int compressionType
  • Constructor Details

    • DataBlockCompressed

      public DataBlockCompressed()
    • DataBlockCompressed

      public DataBlockCompressed(byte[] compressedData, int atomCount)
  • Method Details

    • copy

      public DataBlockCompressed copy()
      Description copied from class: AbstractDataBlock
      Shallow copy of datablock structure The underlying object is shared
      Specified by:
      copy in interface DataBlock
      Specified by:
      copy in class AbstractDataBlock
    • renew

      public DataBlockCompressed renew()
      Description copied from class: AbstractDataBlock
      Regenerate an identical datablock of same size with a new underlying object
      Specified by:
      renew in interface DataBlock
      Specified by:
      renew in class AbstractDataBlock
      Returns:
      new data block
    • clone

      public DataBlockCompressed clone()
      Description copied from class: AbstractDataBlock
      Full copy of datablock structure and values A new underlying object is created with the same values
      Specified by:
      clone in interface DataBlock
      Specified by:
      clone in class AbstractDataBlock
    • getCompressionType

      public int getCompressionType()
    • setCompressionType

      public void setCompressionType(int compressionType)
    • getUnderlyingObject

      public byte[] getUnderlyingObject()
      Description copied from class: AbstractDataBlock
      Allow direct access to underlying object carrying the data (usually a primitive array or composite)
      Specified by:
      getUnderlyingObject in interface DataBlock
      Specified by:
      getUnderlyingObject in class AbstractDataBlock
      Returns:
      underlying object
    • setUnderlyingObject

      public void setUnderlyingObject(byte[] compressedData)
    • setUnderlyingObject

      public void setUnderlyingObject(Object obj)
      Description copied from class: AbstractDataBlock
      Allows to set the underlying object directly
      Specified by:
      setUnderlyingObject in interface DataBlock
      Specified by:
      setUnderlyingObject in class AbstractDataBlock
    • getAtomCount

      public final int getAtomCount()
      Description copied from class: AbstractDataBlock
      Returns number of scalar values in this DataBlock
      Specified by:
      getAtomCount in interface DataBlock
      Overrides:
      getAtomCount in class AbstractDataBlock
    • resize

      public void resize(int size)
    • getDataType

      public DataType getDataType()
    • getDataType

      public DataType getDataType(int index)
    • getBooleanValue

      public final boolean getBooleanValue(int index)
    • getByteValue

      public final byte getByteValue(int index)
    • getShortValue

      public final short getShortValue(int index)
    • getIntValue

      public final int getIntValue(int index)
    • getLongValue

      public final long getLongValue(int index)
    • getFloatValue

      public final float getFloatValue(int index)
    • getDoubleValue

      public final double getDoubleValue(int index)
    • getStringValue

      public final String getStringValue(int index)
    • getBooleanValue

      public final boolean getBooleanValue()
    • getByteValue

      public final byte getByteValue()
    • getShortValue

      public final short getShortValue()
    • getIntValue

      public final int getIntValue()
    • getLongValue

      public final long getLongValue()
    • getFloatValue

      public final float getFloatValue()
    • getDoubleValue

      public final double getDoubleValue()
    • getStringValue

      public final String getStringValue()
    • ensureUncompressed

      public final void ensureUncompressed()
    • setBooleanValue

      public void setBooleanValue(int index, boolean value)
    • setByteValue

      public void setByteValue(int index, byte value)
    • setShortValue

      public void setShortValue(int index, short value)
    • setIntValue

      public void setIntValue(int index, int value)
    • setLongValue

      public void setLongValue(int index, long value)
    • setFloatValue

      public void setFloatValue(int index, float value)
    • setDoubleValue

      public void setDoubleValue(int index, double value)
    • setStringValue

      public void setStringValue(int index, String value)
    • setBooleanValue

      public void setBooleanValue(boolean value)
    • setByteValue

      public void setByteValue(byte value)
    • setShortValue

      public void setShortValue(short value)
    • setIntValue

      public void setIntValue(int value)
    • setLongValue

      public void setLongValue(long value)
    • setFloatValue

      public void setFloatValue(float value)
    • setDoubleValue

      public void setDoubleValue(double value)
    • setStringValue

      public void setStringValue(String value)