public class DataBlockMixed extends AbstractDataBlock
Uses the composite pattern to carry a fixed size array of mixed types DataBlocks. If dynamic size is needed, use DataBlockList. Children datablocks will be read sequentially.
Modifier and Type | Field and Description |
---|---|
protected AbstractDataBlock[] |
blockArray |
protected int |
blockIndex |
protected int |
localIndex |
atomCount, startIndex
Constructor and Description |
---|
DataBlockMixed() |
DataBlockMixed(AbstractDataBlock... childBlocks) |
DataBlockMixed(int numBlocks) |
DataBlockMixed(int numBlocks,
int atomCount) |
Modifier and Type | Method and Description |
---|---|
DataBlockMixed |
clone()
Full copy of datablock structure and values
A new underlying object is created with the same values
|
DataBlockMixed |
copy()
Shallow copy of datablock structure
The underlying object is shared
|
boolean |
getBooleanValue() |
boolean |
getBooleanValue(int index) |
byte |
getByteValue() |
byte |
getByteValue(int index) |
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) |
AbstractDataBlock[] |
getUnderlyingObject()
Allow direct access to underlying object carrying
the data (usually a primitive array or composite)
|
DataBlockMixed |
renew()
Regenerate an identical datablock of same
size with a new underlying object
|
void |
resize(int size) |
protected void |
selectBlock(int index) |
void |
setBlock(int blockIndex,
AbstractDataBlock dataBlock) |
void |
setBooleanValue(boolean value) |
void |
setBooleanValue(int index,
boolean value) |
void |
setByteValue(byte value) |
void |
setByteValue(int index,
byte value) |
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(AbstractDataBlock[] blockArray) |
void |
setUnderlyingObject(Object obj)
Allows to set the underlying object directly
|
String |
toString() |
getAtomCount
protected AbstractDataBlock[] blockArray
protected int blockIndex
protected int localIndex
public DataBlockMixed()
public DataBlockMixed(int numBlocks)
public DataBlockMixed(int numBlocks, int atomCount)
public DataBlockMixed(AbstractDataBlock... childBlocks)
public DataBlockMixed copy()
AbstractDataBlock
copy
in interface DataBlock
copy
in class AbstractDataBlock
public DataBlockMixed renew()
AbstractDataBlock
renew
in interface DataBlock
renew
in class AbstractDataBlock
public DataBlockMixed clone()
AbstractDataBlock
clone
in interface DataBlock
clone
in class AbstractDataBlock
public AbstractDataBlock[] getUnderlyingObject()
AbstractDataBlock
getUnderlyingObject
in interface DataBlock
getUnderlyingObject
in class AbstractDataBlock
public void setUnderlyingObject(AbstractDataBlock[] blockArray)
public void setUnderlyingObject(Object obj)
AbstractDataBlock
setUnderlyingObject
in interface DataBlock
setUnderlyingObject
in class AbstractDataBlock
public DataType getDataType()
public DataType getDataType(int index)
public void resize(int size)
protected void selectBlock(int index)
public String toString()
toString
in class AbstractDataBlock
public boolean getBooleanValue(int index)
public byte getByteValue(int index)
public short getShortValue(int index)
public int getIntValue(int index)
public long getLongValue(int index)
public float getFloatValue(int index)
public double getDoubleValue(int index)
public String getStringValue(int index)
public boolean getBooleanValue()
public byte getByteValue()
public short getShortValue()
public int getIntValue()
public long getLongValue()
public float getFloatValue()
public double getDoubleValue()
public String getStringValue()
public void setBlock(int blockIndex, AbstractDataBlock dataBlock)
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.