Package org.vast.data
Class DataBlockCompressed
java.lang.Object
org.vast.data.AbstractDataBlock
org.vast.data.DataBlockCompressed
- All Implemented Interfaces:
Serializable
,DataBlock
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 Summary
FieldsFields inherited from class org.vast.data.AbstractDataBlock
atomCount, startIndex
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()
Full copy of datablock structure and values A new underlying object is created with the same valuescopy()
Shallow copy of datablock structure The underlying object is sharedfinal void
final int
Returns number of scalar values in this DataBlockfinal boolean
final boolean
getBooleanValue
(int index) final byte
final byte
getByteValue
(int index) int
getDataType
(int index) final double
final double
getDoubleValue
(int index) final float
final float
getFloatValue
(int index) final int
final int
getIntValue
(int index) final long
final long
getLongValue
(int index) final short
final short
getShortValue
(int index) final String
final String
getStringValue
(int index) byte[]
Allow direct access to underlying object carrying the data (usually a primitive array or composite)renew()
Regenerate an identical datablock of same size with a new underlying objectvoid
resize
(int size) void
setBooleanValue
(boolean value) void
setBooleanValue
(int index, boolean value) void
setByteValue
(byte value) void
setByteValue
(int index, byte value) void
setCompressionType
(int compressionType) void
setDoubleValue
(double value) void
setDoubleValue
(int index, double value) void
setFloatValue
(float value) void
setFloatValue
(int index, float value) void
setIntValue
(int value) void
setIntValue
(int index, int value) void
setLongValue
(int index, long value) void
setLongValue
(long value) void
setShortValue
(int index, short value) void
setShortValue
(short value) void
setStringValue
(int index, String value) void
setStringValue
(String value) void
setUnderlyingObject
(byte[] compressedData) void
Allows to set the underlying object directlyMethods inherited from class org.vast.data.AbstractDataBlock
toString, updateAtomCount
-
Field Details
-
compressedData
protected byte[] compressedData -
uncompressedData
-
compressionType
protected int compressionType
-
-
Constructor Details
-
DataBlockCompressed
public DataBlockCompressed() -
DataBlockCompressed
public DataBlockCompressed(byte[] compressedData, int atomCount)
-
-
Method Details
-
copy
Description copied from class:AbstractDataBlock
Shallow copy of datablock structure The underlying object is shared- Specified by:
copy
in interfaceDataBlock
- Specified by:
copy
in classAbstractDataBlock
-
renew
Description copied from class:AbstractDataBlock
Regenerate an identical datablock of same size with a new underlying object- Specified by:
renew
in interfaceDataBlock
- Specified by:
renew
in classAbstractDataBlock
- Returns:
- new data block
-
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 interfaceDataBlock
- Specified by:
clone
in classAbstractDataBlock
-
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 interfaceDataBlock
- Specified by:
getUnderlyingObject
in classAbstractDataBlock
- Returns:
- underlying object
-
setUnderlyingObject
public void setUnderlyingObject(byte[] compressedData) -
setUnderlyingObject
Description copied from class:AbstractDataBlock
Allows to set the underlying object directly- Specified by:
setUnderlyingObject
in interfaceDataBlock
- Specified by:
setUnderlyingObject
in classAbstractDataBlock
-
getAtomCount
public final int getAtomCount()Description copied from class:AbstractDataBlock
Returns number of scalar values in this DataBlock- Specified by:
getAtomCount
in interfaceDataBlock
- Overrides:
getAtomCount
in classAbstractDataBlock
-
resize
public void resize(int size) -
getDataType
-
getDataType
-
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
-
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
-
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
-
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
-