|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.rbnb.api.DataBlock
public final class DataBlock
Describes and provides the data belonging to an Rmap.
A DataBlock consists of three basic parts:
The size of the data in the DataBlock is required and consists
of:
The description of the data (DataReference) is optional and
consists of:
The data payload is optional and consists of a java.util.Vector
containing one or more arrays of data. The arrays can be one of two cases:
DataReference,
Rmap,
Serialized Form| Field Summary | |
|---|---|
static byte |
ORDER_LSB
Least-Significant-Byte first (big-endian, Intel) byte ordering. |
static byte |
ORDER_MSB
Most-Significant-Byte first (little-endian, Java) byte order. |
static byte |
TYPE_BOOLEAN
Boolean (8-bit, one byte) data type. |
static byte |
TYPE_BYTEARRAY
Byte array data type. |
static byte |
TYPE_FLOAT32
32-bit (four byte) floating point data type. |
static byte |
TYPE_FLOAT64
64-bit (eight byte) floating point data type. |
static byte |
TYPE_FROM_INPUT
Take the data type from the input data payload. |
static byte |
TYPE_INT16
16-bit (two byte) signed integer data type. |
static byte |
TYPE_INT32
32-bit (four byte) signed integer data type. |
static byte |
TYPE_INT64
64-bit (eight byte) signed integer data type. |
static byte |
TYPE_INT8
8-bit (one byte) signed integer data type. |
static byte |
TYPE_STRING
Character string data type. |
static byte |
TYPE_USER
User registration type. |
static byte |
UNKNOWN
Unknown data type or byte ordering. |
| Constructor Summary | |
|---|---|
DataBlock()
Class constructor. |
|
DataBlock(Object dataI,
int ndataI,
int ptsizeI)
Class constructor to build a DataBlock from the basic
fields. |
|
DataBlock(Object dataI,
int ndataI,
int ptsizeI,
byte dtypeI,
byte worderI,
boolean indivflgI,
int offsetI,
int strideI)
Class constructor to build a DataBlock from the data
payload and description from the input values. |
|
DataBlock(Object dataI,
int ndataI,
int ptsizeI,
byte dtypeI,
String mimeTypeI,
byte worderI,
boolean indivflgI,
int offsetI,
int strideI)
Class constructor to build a DataBlock from the data
payload and description from the input values. |
|
| Method Summary | |
|---|---|
void |
addData(Object dataI,
int nPtsI)
Adds more data. |
Object |
clone()
Clones this DataBlock. |
Object |
extractData(DataBlock dRefI)
Extracts data from this data pool for the input DataBlock. |
Vector |
getData()
Gets the data payload. |
byte |
getDtype()
Gets the type of data. |
boolean |
getIndivFlg()
Gets the indivisible flag. |
String |
getMIMEType()
Gets the MIME type. |
int |
getNpts()
Gets the number of points. |
int |
getOffset()
Gets the number of bytes to the first point. |
int |
getPtsize()
Gets the size of a point in bytes. |
int |
getStride()
Gets the number of bytes to the next point. |
byte |
getWorder()
Gets the order of bytes within a point. |
void |
nullify()
Nullifies this DataBlock. |
void |
set(Object dataI,
int ndataI,
int ptsizeI)
Sets the data payload and description using basic values. |
void |
set(Object dataI,
int ndataI,
int ptsizeI,
byte dtypeI,
byte worderI,
boolean indivflgI,
int offsetI,
int strideI)
Sets the data payload and description from the input values. |
void |
set(Object dataI,
int ndataI,
int ptsizeI,
byte dtypeI,
String mimeTypeI,
byte worderI,
boolean indivflgI,
int offsetI,
int strideI)
Sets the data payload and description from the input values. |
void |
setData(Object dataI)
Sets the data payload. |
void |
setDtype(byte dtypeI)
Sets the type of data. |
void |
setIndivFlg(boolean indivflgI)
Sets the indivisible flag. |
void |
setMIMEType(String mimeTypeI)
Sets the MIME type. |
void |
setNpts(int nptsI)
Sets the number of points. |
void |
setOffset(int offsetI)
Sets the number of bytes to the first point. |
void |
setOffsetStride(int offsetI,
int strideI)
Sets the offset in bytes to the start of the first point and the stride in bytes between points. |
void |
setPtsize(int ptsizeI)
Sets the size of a point in bytes. |
void |
setStride(int strideI)
Sets the number of bytes to the next point. |
void |
setWorder(byte worderI)
Sets the order of bytes within a point. |
String |
toString()
Gets a displayable string representation of this DataBlock. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final byte UNKNOWN
public static final byte ORDER_LSB
public static final byte ORDER_MSB
public static final byte TYPE_FROM_INPUT
The resulting data type value will be one of the other types.
public static final byte TYPE_BOOLEAN
public static final byte TYPE_INT8
public static final byte TYPE_INT16
public static final byte TYPE_INT32
public static final byte TYPE_INT64
public static final byte TYPE_FLOAT32
public static final byte TYPE_FLOAT64
public static final byte TYPE_STRING
public static final byte TYPE_BYTEARRAY
public static final byte TYPE_USER
| Constructor Detail |
|---|
public DataBlock()
public DataBlock(Object dataI,
int ndataI,
int ptsizeI)
DataBlock from the basic
fields.
dataI - the data payload.ndataI - the number of points.ptsizeI - the number of bytes in a single point.
IllegalArgumentException - thrown if the number of points or point size is not positive
or if they do not match the size of the data payload.
public DataBlock(Object dataI,
int ndataI,
int ptsizeI,
byte dtypeI,
byte worderI,
boolean indivflgI,
int offsetI,
int strideI)
DataBlock from the data
payload and description from the input values.
dataI - the data payload.ndataI - the number of points.ptsizeI - the number of bytes in a single point.dtypeI - the type of data.worderI - the word order of the data.indivflgI - are points are individually accessible?offsetI - the offset in bytes to the first point.strideI - the stride in bytes to the next point.
IllegalArgumentException - thrown if:
getData(),
getDtype(),
getIndivFlg(),
getNpts(),
getOffset(),
getPtsize(),
getStride()
public DataBlock(Object dataI,
int ndataI,
int ptsizeI,
byte dtypeI,
String mimeTypeI,
byte worderI,
boolean indivflgI,
int offsetI,
int strideI)
DataBlock from the data
payload and description from the input values.
This version handles MIME data.
dataI - the data payload.ndataI - the number of points.ptsizeI - the number of bytes in a single point.dtypeI - the type of data.mimeTypeI - the MIME type.worderI - the word order of the data.indivflgI - are points are individually accessible?offsetI - the offset in bytes to the first point.strideI - the stride in bytes to the next point.
IllegalArgumentException - thrown if:
getData(),
getDtype(),
getIndivFlg(),
getMIMEType(),
getNpts(),
getOffset(),
getStride()| Method Detail |
|---|
public final void addData(Object dataI,
int nPtsI)
This method adds the additional data as a new element of the data vector. There must already be data in the vector.
dataI - the data to add.nPtsI - the number of additional points.public final Object clone()
DataBlock.
This method clones the data reference and payload.
public final Object extractData(DataBlock dRefI)
DataBlock.
This method supports extracting from byte arrays in all cases and from other primitive types so long as the extraction doesn't change the type.
When extracting from an array of bytes or from an vector of arrays of
bytes, the method creates an output byte array and fills it in using
System.arraycopy.
When extracting from an array of some other primitive type, the method
creates an output array of that data type and fills it in using
System.arraycopy.
dRefI - the DataReference (DataBlock).
IllegalStateException - thrown if there is a mismatch between this data pool and the
the DataReference.public final Vector getData()
The data payload is a java.util.Vector containing either:
setData(Object)public final byte getDtype()
setDtype(byte)public final boolean getIndivFlg()
setIndivFlg(boolean)public final String getMIMEType()
setMIMEType(String)public final int getNpts()
setNpts(int)public final int getOffset()
setOffset(int),
setOffsetStride(int,int)public final int getPtsize()
setPtsize(int)public final int getStride()
setStride(int)public final byte getWorder()
setWorder(byte)public final void nullify()
DataBlock.
This method ensures that all pointers in this DataBlock
are cleared, reducing the effort needed by the garbage collector to
clean it up.
public final void set(Object dataI,
int ndataI,
int ptsizeI)
The extended DataReference values are defaulted as follows:
dtype is set to DataBlock.UNKNOWN,worder is set to DataBlock.UNKNOWN,
indivflg is set to false,offset is set to 0, andstride is set to ptsizeI.
dataI - the data payload.ndataI - the number of points.ptsizeI - the number of bytes in a single point.
IllegalArgumentException - thrown if the number of points or point size are not
positive or if they do not match the size of the data
payload.getData(),
getNpts(),
getPtsize()
public final void set(Object dataI,
int ndataI,
int ptsizeI,
byte dtypeI,
byte worderI,
boolean indivflgI,
int offsetI,
int strideI)
dataI - the data payload.ndataI - the number of points.ptsizeI - the number of bytes in a single point.dtypeI - the type of data.worderI - the word order of the data.indivflgI - are points are individually accessible?offsetI - the offset in bytes to the first point.strideI - the stride in bytes to the next point.
IllegalArgumentException - thrown if:
getData(),
getDtype(),
getIndivFlg(),
getNpts(),
getOffset(),
getPtsize(),
getStride()
public final void set(Object dataI,
int ndataI,
int ptsizeI,
byte dtypeI,
String mimeTypeI,
byte worderI,
boolean indivflgI,
int offsetI,
int strideI)
dataI - the data payload.ndataI - the number of points.ptsizeI - the number of bytes in a single point.dtypeI - the type of data.mimeTypeI - the MIME type.worderI - the word order of the data.indivflgI - are points are individually accessible?offsetI - the offset in bytes to the first point.strideI - the stride in bytes to the next point.
IllegalArgumentException - thrown if:
getData(),
getDtype(),
getIndivFlg(),
getNpts(),
getOffset(),
getPtsize(),
getStride()public final void setData(Object dataI)
dataI - the data payload.getData()public final void setDtype(byte dtypeI)
dtypeI - the type of data.
IllegalArgumentException - thrown if the data type doesn't match the point size or the
type of the data payload.getDtype()public final void setIndivFlg(boolean indivflgI)
indivflgI - individual points are not accessible?getIndivFlg()public final void setMIMEType(String mimeTypeI)
mimeTypeI - the MIME type.getMIMEType()public final void setNpts(int nptsI)
nptsI - the number of points.getNpts()public final void setOffset(int offsetI)
offsetI - the number of bytes to the first point.
IllegalArgumentException - thrown if the offset is negative or if there is a data
payload.getOffset(),
setOffsetStride(int,int)
public final void setOffsetStride(int offsetI,
int strideI)
offsetI - The number of bytes to the first point.strideI - The number of bytes between points.
IllegalArgumentException - thrown if the offset is negative, the stride is nnegative,
or if there is a data payload.getOffset(),
getStride(),
setOffset(int),
setStride(int)public final void setPtsize(int ptsizeI)
ptsizeI - the point size in bytes.getPtsize()public final void setStride(int strideI)
strideI - the number of bytes to the next point.
IllegalArgumentException - thrown if the stride is negative or if there is a data
payload and the stride is non-zero and not equal to the point
size.getStride(),
setOffsetStride(int,int)public final void setWorder(byte worderI)
worderI - the word order.
IllegalArgumentException - thrown if the word order is not a legal value.getWorder()public final String toString()
DataBlock.
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||