public abstract class Pdu
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
protected byte |
exerciseID
Exercise ID
|
protected short |
length
Length, in bytes, of the PDU
|
protected DISPDUType |
pduType
Type of pdu, unique for each PDU class uid 4
|
protected DISProtocolFamily |
protocolFamily
value that refers to the protocol family, eg SimulationManagement, et uid 5
|
protected DISProtocolVersion |
protocolVersion
The version of the protocol.
|
protected int |
timestamp
Timestamp value
|
Constructor and Description |
---|
Pdu()
Constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
boolean |
equalsImpl(java.lang.Object obj)
Compare all fields that contribute to the state, ignoring
transient and static fields, for
this and the supplied object |
byte |
getExerciseID()
Getter for
exerciseID |
short |
getLength()
Getter for
length |
int |
getMarshalledSize()
Returns the size of this serialized object in bytes
|
DISPDUType |
getPduType()
Getter for
pduType |
DISProtocolFamily |
getProtocolFamily()
Getter for
protocolFamily |
DISProtocolVersion |
getProtocolVersion()
Getter for
protocolVersion |
int |
getTimestamp()
Getter for
timestamp |
byte[] |
marshal()
A convenience method for marshalling to a byte array.
|
void |
marshal(java.nio.ByteBuffer buff)
Packs an object into the ByteBuffer.
|
void |
marshal(java.io.DataOutputStream dos)
Serializes an object to a DataOutputStream.
|
Pdu |
setExerciseID(byte pExerciseID)
Setter for
exerciseID |
Pdu |
setLength(short pLength)
Setter for
length |
Pdu |
setPduType(DISPDUType pPduType)
Setter for
pduType |
Pdu |
setProtocolFamily(DISProtocolFamily pProtocolFamily)
Setter for
protocolFamily |
Pdu |
setProtocolVersion(DISProtocolVersion pProtocolVersion)
Setter for
protocolVersion |
Pdu |
setTimestamp(int pTimestamp)
Setter for
timestamp |
int |
unmarshal(java.nio.ByteBuffer buff)
Unpacks a Pdu from the underlying data.
|
int |
unmarshal(java.io.DataInputStream dis)
Unserializes an object from a DataInputStream.
|
protected DISProtocolVersion protocolVersion
protected byte exerciseID
protected DISPDUType pduType
protected DISProtocolFamily protocolFamily
protected int timestamp
protected short length
public int getMarshalledSize()
public Pdu setProtocolVersion(DISProtocolVersion pProtocolVersion)
protocolVersion
public DISProtocolVersion getProtocolVersion()
protocolVersion
public Pdu setExerciseID(byte pExerciseID)
exerciseID
public byte getExerciseID()
exerciseID
public Pdu setPduType(DISPDUType pPduType)
pduType
public DISPDUType getPduType()
pduType
public Pdu setProtocolFamily(DISProtocolFamily pProtocolFamily)
protocolFamily
public DISProtocolFamily getProtocolFamily()
protocolFamily
public int getTimestamp()
timestamp
public short getLength()
length
public void marshal(java.io.DataOutputStream dos)
dos
- The DataOutputStreamDataOutputStream
public int unmarshal(java.io.DataInputStream dis)
dis
- The DataInputStreamDataInputStream
public void marshal(java.nio.ByteBuffer buff) throws java.lang.Exception
buff
- The ByteBuffer at the position to begin writingjava.nio.BufferOverflowException
- if buff is too smalljava.nio.ReadOnlyBufferException
- if buff is read onlyjava.lang.Exception
- ByteBuffer-generated exceptionByteBuffer
public int unmarshal(java.nio.ByteBuffer buff) throws java.lang.Exception
buff
- The ByteBuffer at the position to begin readingjava.nio.BufferUnderflowException
- if buff is too smalljava.lang.Exception
- ByteBuffer-generated exceptionByteBuffer
public byte[] marshal() throws java.lang.Exception
Pdu
java.lang.Exception
- ByteBuffer-generated exceptionpublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public boolean equalsImpl(java.lang.Object obj)
this
and the supplied objectobj
- the object to compare to