Package mpi
Class Struct.Data
- java.lang.Object
-
- mpi.Struct.Data
-
- Direct Known Subclasses:
DoubleInt.Data,FloatInt.Data,Int2.Data,LongInt.Data,ShortInt.Data
- Enclosing class:
- Struct
public abstract class Struct.Data extends java.lang.ObjectBase class for reading/writing data in a struct stored in a byte buffer.
-
-
Constructor Summary
Constructors Constructor Description Data()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.nio.ByteBuffergetBuffer()Gets the buffer where this struct data is stored.protected java.nio.ByteBuffergetBuffer(Datatype type, int field)Gets the buffer of a field.protected java.nio.ByteBuffergetBuffer(Datatype type, int field, int index)Gets the buffer data at the specified position of a buffer array.protected bytegetByte(int field)Gets the byte value of a field.protected bytegetByte(int field, int index)Gets the byte value at the specified position of a byte array.protected chargetChar(int field)Gets the char value of a field.protected chargetChar(int field, int index)Gets the char value at the specified position of a char array.protected <S extends Struct,D extends Struct.Data>
DgetData(S struct, int field)protected <S extends Struct,D extends Struct.Data>
DgetData(S struct, int field, int index)protected doublegetDouble(int field)Gets the double value of a field.protected doublegetDouble(int field, int index)Gets the double value at the specified position of a double array.protected floatgetFloat(int field)Gets the float value of a field.protected floatgetFloat(int field, int index)Gets the float value at the specified position of a float array.protected intgetInt(int field)Gets the int value of a field.protected intgetInt(int field, int index)Gets the int value at the specified position of an int array.protected longgetLong(int field)Gets the long value of a field.protected longgetLong(int field, int index)Gets the long value at the specified position of a long array.protected shortgetShort(int field)Gets the short value of a field.protected shortgetShort(int field, int index)Gets the short value at the specified position of a short array.protected voidputByte(int field, byte v)Puts a byte value in a field.protected voidputByte(int field, int index, byte v)Puts a byte value at the specified position of a byte array.protected voidputChar(int field, char v)Puts a char value in a field.protected voidputChar(int field, int index, char v)Puts a char value at the specified position of a char array.protected voidputDouble(int field, double v)Puts a double value in a field.protected voidputDouble(int field, int index, double v)Puts a double value at the specified position of a double array.protected voidputFloat(int field, float v)Puts a float value in a field.protected voidputFloat(int field, int index, float v)Puts a float value at the specified position of a float array.protected voidputInt(int field, int v)Puts an int value in a field.protected voidputInt(int field, int index, int v)Puts an int value at the specified position of an int array.protected voidputLong(int field, int index, long v)Puts a long value at the specified position of a long array.protected voidputLong(int field, long v)Puts a long value in a field.protected voidputShort(int field, int index, short v)Puts a short value at the specified position of a short array.protected voidputShort(int field, short v)Puts a short value in a field.
-
-
-
Method Detail
-
getBuffer
public final java.nio.ByteBuffer getBuffer()
Gets the buffer where this struct data is stored.The buffer can be used in
send/recvoperations.- Returns:
- Buffer where the struct data is stored.
-
getByte
protected final byte getByte(int field)
Gets the byte value of a field.- Parameters:
field- Offset of the field.- Returns:
- Byte value.
-
getByte
protected final byte getByte(int field, int index)Gets the byte value at the specified position of a byte array.- Parameters:
field- Offset of the byte array.index- Index of the byte in the array.- Returns:
- Byte value.
-
putByte
protected final void putByte(int field, byte v)Puts a byte value in a field.- Parameters:
field- Offset of the field.v- Byte value.
-
putByte
protected final void putByte(int field, int index, byte v)Puts a byte value at the specified position of a byte array.- Parameters:
field- Offset of the byte array.index- Index of the byte in the array.v- Byte value.
-
getChar
protected final char getChar(int field)
Gets the char value of a field.- Parameters:
field- Offset of the field.- Returns:
- Char value.
-
getChar
protected final char getChar(int field, int index)Gets the char value at the specified position of a char array.- Parameters:
field- Offset of the char array.index- Index of the char in the array.- Returns:
- Char value.
-
putChar
protected final void putChar(int field, char v)Puts a char value in a field.- Parameters:
field- Offset of the field.v- Char value.
-
putChar
protected final void putChar(int field, int index, char v)Puts a char value at the specified position of a char array.- Parameters:
field- Offset of the char array.index- Index of the char in the array.v- Char value.
-
getShort
protected final short getShort(int field)
Gets the short value of a field.- Parameters:
field- Offset of the field.- Returns:
- Short value.
-
getShort
protected final short getShort(int field, int index)Gets the short value at the specified position of a short array.- Parameters:
field- Offset of the short array.index- Index of the short in the array.- Returns:
- Short value.
-
putShort
protected final void putShort(int field, short v)Puts a short value in a field.- Parameters:
field- Offset of the field.v- Short value.
-
putShort
protected final void putShort(int field, int index, short v)Puts a short value at the specified position of a short array.- Parameters:
field- Offset of the short array.index- Index of the short in the array.v- Short value.
-
getInt
protected final int getInt(int field)
Gets the int value of a field.- Parameters:
field- Offset of the field.- Returns:
- Int value.
-
getInt
protected final int getInt(int field, int index)Gets the int value at the specified position of an int array.- Parameters:
field- Offset of the int array.index- Index of the int in the array.- Returns:
- Int value.
-
putInt
protected final void putInt(int field, int v)Puts an int value in a field.- Parameters:
field- Offset of the field.v- Int value.
-
putInt
protected final void putInt(int field, int index, int v)Puts an int value at the specified position of an int array.- Parameters:
field- Offset of the int array.index- Index of the int in the array.v- Int value.
-
getLong
protected final long getLong(int field)
Gets the long value of a field.- Parameters:
field- Offset of the field.- Returns:
- Long value.
-
getLong
protected final long getLong(int field, int index)Gets the long value at the specified position of a long array.- Parameters:
field- Offset of the long array.index- Index of the long in the array.- Returns:
- Long value.
-
putLong
protected final void putLong(int field, long v)Puts a long value in a field.- Parameters:
field- Offset of the field.v- Long value.
-
putLong
protected final void putLong(int field, int index, long v)Puts a long value at the specified position of a long array.- Parameters:
field- Offset of the long array.index- Index of the long in the array.v- Long value.
-
getFloat
protected final float getFloat(int field)
Gets the float value of a field.- Parameters:
field- Offset of the field.- Returns:
- Float value.
-
getFloat
protected final float getFloat(int field, int index)Gets the float value at the specified position of a float array.- Parameters:
field- Offset of the float array.index- Index of the float in the array.- Returns:
- Float value.
-
putFloat
protected final void putFloat(int field, float v)Puts a float value in a field.- Parameters:
field- Offset of the field.v- Float value.
-
putFloat
protected final void putFloat(int field, int index, float v)Puts a float value at the specified position of a float array.- Parameters:
field- Offset of the float array.index- Index of the float in the array.v- Float value.
-
getDouble
protected final double getDouble(int field)
Gets the double value of a field.- Parameters:
field- Offset of the field.- Returns:
- Double value.
-
getDouble
protected final double getDouble(int field, int index)Gets the double value at the specified position of a double array.- Parameters:
field- Offset of the double array.index- Index of the double in the array.- Returns:
- Double value.
-
putDouble
protected final void putDouble(int field, double v)Puts a double value in a field.- Parameters:
field- Offset of the field.v- Double value.
-
putDouble
protected final void putDouble(int field, int index, double v)Puts a double value at the specified position of a double array.- Parameters:
field- Offset of the double array.index- Index of the double in the array.v- Double value.
-
getData
protected final <S extends Struct,D extends Struct.Data> D getData(S struct, int field)
-
getData
protected final <S extends Struct,D extends Struct.Data> D getData(S struct, int field, int index)
-
getBuffer
protected final java.nio.ByteBuffer getBuffer(Datatype type, int field)
Gets the buffer of a field.The buffer can be used in
send/recvoperations.- Parameters:
type- Data type of the buffer.field- Offset of the field.- Returns:
- Buffer object.
-
getBuffer
protected final java.nio.ByteBuffer getBuffer(Datatype type, int field, int index) throws MPIException
Gets the buffer data at the specified position of a buffer array.The buffer can be used in
send/recvoperations.- Parameters:
type- Data type of the buffer.field- Offset of the buffer array.index- Index of the buffer in the array.- Returns:
- Buffer object.
- Throws:
MPIException- Signals that an MPI exception of some sort has occurred.
-
-