Package edu.nps.moves.dis7.pdus
Class LiveEntityPdu
java.lang.Object
edu.nps.moves.dis7.pdus.Pdu
edu.nps.moves.dis7.pdus.LiveEntityPdu
- All Implemented Interfaces:
Marshaller
,Serializable
The live entity PDUs have a slightly different header
IEEE Std 1278.1-2012, IEEE Standard for Distributed Interactive Simulation - Application Protocols
- See Also:
- Serialized Form
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected byte
zero-filled array of paddingprotected DISLiveEntitySubprotocolNumber
Subprotocol used to decode the PDU.Fields inherited from class edu.nps.moves.dis7.pdus.Pdu
exerciseID, length, pduType, protocolFamily, protocolVersion, timestamp
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
equalsImpl(Object obj)
Compare all fields that contribute to the state, ignoring transient and static fields, forthis
and the supplied objectint
Returns size of this serialized (marshalled) object in bytesbyte
Getter forpadding
Getter forsubprotocolNumber
void
marshal(DataOutputStream dos)
Serializes an object to a DataOutputStream.void
marshal(ByteBuffer byteBuffer)
Packs an object into the ByteBuffer.setPadding(byte pPadding)
Setter forpadding
setPadding(int pPadding)
Utility setter forpadding
setSubprotocolNumber(DISLiveEntitySubprotocolNumber pSubprotocolNumber)
Setter forsubprotocolNumber
toString()
int
unmarshal(DataInputStream dis)
Deserializes an object from a DataInputStream.int
unmarshal(ByteBuffer byteBuffer)
Unpacks a Pdu from the underlying data.Methods inherited from class edu.nps.moves.dis7.pdus.Pdu
getExerciseID, getLength, getPduType, getProtocolFamily, getProtocolVersion, getTimestamp, marshal, setExerciseID, setExerciseID, setLength, setLength, setPduType, setProtocolFamily, setProtocolVersion, setTimestamp
-
Field Details
-
subprotocolNumber
Subprotocol used to decode the PDU. Section 13 of EBV. uid 417 -
padding
protected byte paddingzero-filled array of padding
-
-
Constructor Details
-
LiveEntityPdu
public LiveEntityPdu()Constructor
-
-
Method Details
-
getMarshalledSize
public int getMarshalledSize()Returns size of this serialized (marshalled) object in bytes- Specified by:
getMarshalledSize
in interfaceMarshaller
- Overrides:
getMarshalledSize
in classPdu
- Returns:
- serialized size in bytes
- See Also:
- https://en.wikipedia.org/wiki/Marshalling_(computer_science)
-
setSubprotocolNumber
Setter forsubprotocolNumber
- Parameters:
pSubprotocolNumber
- new value of interest- Returns:
- same object to permit progressive setters
-
getSubprotocolNumber
Getter forsubprotocolNumber
- Returns:
- value of interest
-
setPadding
Setter forpadding
- Parameters:
pPadding
- new value of interest- Returns:
- same object to permit progressive setters
-
setPadding
Utility setter forpadding
- Parameters:
pPadding
- new value of interest- Returns:
- same object to permit progressive setters
-
getPadding
public byte getPadding()Getter forpadding
- Returns:
- value of interest
-
marshal
Serializes an object to a DataOutputStream.- Specified by:
marshal
in interfaceMarshaller
- Overrides:
marshal
in classPdu
- Parameters:
dos
- the OutputStream- Throws:
Exception
- if something goes wrong- See Also:
DataOutputStream
-
unmarshal
Deserializes an object from a DataInputStream.- Specified by:
unmarshal
in interfaceMarshaller
- Overrides:
unmarshal
in classPdu
- Parameters:
dis
- the InputStream- Returns:
- marshalled serialized size in bytes
- Throws:
Exception
- if something goes wrong- See Also:
DataInputStream
, https://en.wikipedia.org/wiki/Marshalling_(computer_science)
-
marshal
Packs an object into the ByteBuffer.- Specified by:
marshal
in interfaceMarshaller
- Overrides:
marshal
in classPdu
- Parameters:
byteBuffer
- The ByteBuffer at the position to begin writing- Throws:
BufferOverflowException
- if byteBuffer is too smallReadOnlyBufferException
- if byteBuffer is read onlyException
- ByteBuffer-generated exception- See Also:
ByteBuffer
-
unmarshal
Unpacks a Pdu from the underlying data.- Specified by:
unmarshal
in interfaceMarshaller
- Overrides:
unmarshal
in classPdu
- Parameters:
byteBuffer
- The ByteBuffer at the position to begin reading- Returns:
- marshalled serialized size in bytes
- Throws:
BufferUnderflowException
- if byteBuffer is too smallException
- ByteBuffer-generated exception- See Also:
ByteBuffer
, https://en.wikipedia.org/wiki/Marshalling_(computer_science)
-
equals
-
equalsImpl
Description copied from class:Pdu
Compare all fields that contribute to the state, ignoring transient and static fields, forthis
and the supplied object- Overrides:
equalsImpl
in classPdu
- Parameters:
obj
- the object to compare to- Returns:
- true if the objects are equal, false otherwise.
-
toString
-