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.
Modifier and Type | Field and Description |
---|---|
protected byte[] |
compressedData |
protected int |
compressionType |
protected DataBlock |
uncompressedData |
atomCount, startIndex
Constructor and Description |
---|
DataBlockCompressed() |
DataBlockCompressed(byte[] compressedData,
int atomCount) |
Modifier and Type | Method and Description |
---|---|
DataBlockCompressed |
clone()
Full copy of datablock structure and values
A new underlying object is created with the same values
|
DataBlockCompressed |
copy()
Shallow copy of datablock structure
The underlying object is shared
|
void |
ensureUncompressed() |
int |
getAtomCount()
Returns number of scalar values in this DataBlock
|
boolean |
getBooleanValue() |
boolean |
getBooleanValue(int index) |
byte |
getByteValue() |
byte |
getByteValue(int index) |
int |
getCompressionType() |
DataType |
getDataType() |
DataType |
getDataType(int index) |
double |
getDoubleValue() |
double |
getDoubleValue(int index) |
float |
getFloatValue() |
float |
getFloatValue(int index) |
int |
getIntValue() |
int |
getIntValue(int index) |
long |
getLongValue() |
long |
getLongValue(int index) |
short |
getShortValue() |
short |
getShortValue(int index) |
String |
getStringValue() |
String |
getStringValue(int index) |
byte[] |
getUnderlyingObject()
Allow direct access to underlying object carrying
the data (usually a primitive array or composite)
|
DataBlockCompressed |
renew()
Regenerate an identical datablock of same
size with a new underlying object
|
void |
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 |
setUnderlyingObject(Object obj)
Allows to set the underlying object directly
|
toString
protected byte[] compressedData
protected DataBlock uncompressedData
protected int compressionType
public DataBlockCompressed()
public DataBlockCompressed(byte[] compressedData, int atomCount)
public DataBlockCompressed copy()
AbstractDataBlock
copy
in interface DataBlock
copy
in class AbstractDataBlock
public DataBlockCompressed renew()
AbstractDataBlock
renew
in interface DataBlock
renew
in class AbstractDataBlock
public DataBlockCompressed clone()
AbstractDataBlock
clone
in interface DataBlock
clone
in class AbstractDataBlock
public int getCompressionType()
public void setCompressionType(int compressionType)
public byte[] getUnderlyingObject()
AbstractDataBlock
getUnderlyingObject
in interface DataBlock
getUnderlyingObject
in class AbstractDataBlock
public void setUnderlyingObject(byte[] compressedData)
public void setUnderlyingObject(Object obj)
AbstractDataBlock
setUnderlyingObject
in interface DataBlock
setUnderlyingObject
in class AbstractDataBlock
public final int getAtomCount()
AbstractDataBlock
getAtomCount
in interface DataBlock
getAtomCount
in class AbstractDataBlock
public void resize(int size)
public DataType getDataType()
public DataType getDataType(int index)
public final boolean getBooleanValue(int index)
public final byte getByteValue(int index)
public final short getShortValue(int index)
public final int getIntValue(int index)
public final long getLongValue(int index)
public final float getFloatValue(int index)
public final double getDoubleValue(int index)
public final String getStringValue(int index)
public final boolean getBooleanValue()
public final byte getByteValue()
public final short getShortValue()
public final int getIntValue()
public final long getLongValue()
public final float getFloatValue()
public final double getDoubleValue()
public final String getStringValue()
public final void ensureUncompressed()
public void setBooleanValue(int index, boolean value)
public void setByteValue(int index, byte value)
public void setShortValue(int index, short value)
public void setIntValue(int index, int value)
public void setLongValue(int index, long value)
public void setFloatValue(int index, float value)
public void setDoubleValue(int index, double value)
public void setStringValue(int index, String value)
public void setBooleanValue(boolean value)
public void setByteValue(byte value)
public void setShortValue(short value)
public void setIntValue(int value)
public void setLongValue(long value)
public void setFloatValue(float value)
public void setDoubleValue(double value)
public void setStringValue(String value)
Copyright © 2016 Sensia Software LLC. All rights reserved.