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 voidfinal intReturns number of scalar values in this DataBlockfinal booleanfinal booleangetBooleanValue(int index) final bytefinal bytegetByteValue(int index) intgetDataType(int index) final doublefinal doublegetDoubleValue(int index) final floatfinal floatgetFloatValue(int index) final intfinal intgetIntValue(int index) final longfinal longgetLongValue(int index) final shortfinal shortgetShortValue(int index) final Stringfinal StringgetStringValue(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 objectvoidresize(int size) voidsetBooleanValue(boolean value) voidsetBooleanValue(int index, boolean value) voidsetByteValue(byte value) voidsetByteValue(int index, byte value) voidsetCompressionType(int compressionType) voidsetDoubleValue(double value) voidsetDoubleValue(int index, double value) voidsetFloatValue(float value) voidsetFloatValue(int index, float value) voidsetIntValue(int value) voidsetIntValue(int index, int value) voidsetLongValue(int index, long value) voidsetLongValue(long value) voidsetShortValue(int index, short value) voidsetShortValue(short value) voidsetStringValue(int index, String value) voidsetStringValue(String value) voidsetUnderlyingObject(byte[] compressedData) voidAllows 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:AbstractDataBlockShallow copy of datablock structure The underlying object is shared- Specified by:
 copyin interfaceDataBlock- Specified by:
 copyin classAbstractDataBlock
 - 
renew
Description copied from class:AbstractDataBlockRegenerate an identical datablock of same size with a new underlying object- Specified by:
 renewin interfaceDataBlock- Specified by:
 renewin classAbstractDataBlock- Returns:
 - new data block
 
 - 
clone
Description copied from class:AbstractDataBlockFull copy of datablock structure and values A new underlying object is created with the same values- Specified by:
 clonein interfaceDataBlock- Specified by:
 clonein classAbstractDataBlock
 - 
getCompressionType
public int getCompressionType() - 
setCompressionType
public void setCompressionType(int compressionType)  - 
getUnderlyingObject
public byte[] getUnderlyingObject()Description copied from class:AbstractDataBlockAllow direct access to underlying object carrying the data (usually a primitive array or composite)- Specified by:
 getUnderlyingObjectin interfaceDataBlock- Specified by:
 getUnderlyingObjectin classAbstractDataBlock- Returns:
 - underlying object
 
 - 
setUnderlyingObject
public void setUnderlyingObject(byte[] compressedData)  - 
setUnderlyingObject
Description copied from class:AbstractDataBlockAllows to set the underlying object directly- Specified by:
 setUnderlyingObjectin interfaceDataBlock- Specified by:
 setUnderlyingObjectin classAbstractDataBlock
 - 
getAtomCount
public final int getAtomCount()Description copied from class:AbstractDataBlockReturns number of scalar values in this DataBlock- Specified by:
 getAtomCountin interfaceDataBlock- Overrides:
 getAtomCountin 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
 
 -