Modifier and Type | Class and Description |
---|---|
class |
Struct.Data
Base class for reading/writing data in a struct stored in a byte buffer.
|
Constructor and Description |
---|
Struct() |
Modifier and Type | Method and Description |
---|---|
int |
addByte()
Adds a byte field to this struct.
|
int |
addByte(int length)
Adds a byte array to this struct.
|
int |
addChar()
Adds a char field to this struct.
|
int |
addChar(int length)
Adds a char array to this struct.
|
int |
addData(Datatype type)
Adds a field of the specified data type.
|
int |
addData(Datatype type,
int length)
Adds an array of the specified data type.
|
int |
addDouble()
Adds a double field to this struct.
|
int |
addDouble(int length)
Adds a double array to this struct.
|
int |
addFloat()
Adds a float field to this struct.
|
int |
addFloat(int length)
Adds a float array to this struct.
|
int |
addInt()
Adds an int field to this struct.
|
int |
addInt(int length)
Adds an int array to this struct.
|
int |
addLong()
Adds a long field to this struct.
|
int |
addLong(int length)
Adds a long array to this struct.
|
int |
addShort()
Adds a short field to this struct.
|
int |
addShort(int length)
Adds a short array to this struct.
|
int |
addStruct(Struct struct)
Adds a struct field to this struct.
|
int |
addStruct(Struct struct,
int length)
Adds an array of structs to this struct.
|
<T extends Struct.Data> |
getData(byte[] array) |
<T extends Struct.Data> |
getData(byte[] array,
int index) |
<T extends Struct.Data> |
getData(java.nio.ByteBuffer buffer) |
<T extends Struct.Data> |
getData(java.nio.ByteBuffer buffer,
int index) |
int |
getExtent()
Returns the extent of the struct data type.
|
Datatype |
getType()
Returns the data type of the struct.
|
protected abstract Struct.Data |
newData()
Creates a Data object.
|
Struct |
setOffset(int offset)
Sets the offset of the next field.
|
public final int getExtent() throws MPIException
MPIException
- Signals that an MPI exception of some sort has occurred.public final Datatype getType() throws MPIException
MPIException
- Signals that an MPI exception of some sort has occurred.protected abstract Struct.Data newData()
public final <T extends Struct.Data> T getData(java.nio.ByteBuffer buffer) throws MPIException
MPIException
public final <T extends Struct.Data> T getData(java.nio.ByteBuffer buffer, int index) throws MPIException
MPIException
public final <T extends Struct.Data> T getData(byte[] array) throws MPIException
MPIException
public final <T extends Struct.Data> T getData(byte[] array, int index) throws MPIException
MPIException
public final Struct setOffset(int offset)
The offset must be greater or equal to the accumulated extent.
offset
- offset of the next fieldpublic final int addByte()
public final int addByte(int length)
length
- Length of the array.public final int addChar()
public final int addChar(int length)
length
- Length of the array.public final int addShort()
public final int addShort(int length)
length
- Length of the array.public final int addInt()
public final int addInt(int length)
length
- Length of the array.public final int addLong()
public final int addLong(int length)
length
- Length of the array.public final int addFloat()
public final int addFloat(int length)
length
- Length of the array.public final int addDouble()
public final int addDouble(int length)
length
- Length of the array.public final int addStruct(Struct struct) throws MPIException
struct
- Type of the field.MPIException
- Signals that an MPI exception of some sort has occurred.public final int addStruct(Struct struct, int length) throws MPIException
struct
- Type of the array.length
- Length of the array.MPIException
- Signals that an MPI exception of some sort has occurred.public final int addData(Datatype type) throws MPIException
type
- Data type.MPIException
- Signals that an MPI exception of some sort has occurred.public final int addData(Datatype type, int length) throws MPIException
type
- Data type.length
- Length of the array.MPIException
- Signals that an MPI exception of some sort has occurred.