Class RecordSpecificationElement
java.lang.Object
edu.nps.moves.dis7.pdus.RecordSpecificationElement
- All Implemented Interfaces:
Serializable
Synthetic record, made up from section 6.2.73. This is used to achieve a repeating variable list element.
recordLength, recordCount and recordValues must be set by hand so the.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int
zero-filled array of padding bits for byte alignment and consistent sizing of PDU dataprotected byte[]
used if required to make entire record size an even multiple of 8 bytesprotected short
the number of records included in the record setprotected VariableRecordType
The data structure used to convey the parameter values of the record for each record. 32-bit enumeration. uid = 66protected short
the length, in bits, of the record.protected int
The serial number of the first record in the block of recordsprotected byte[]
The concatenated records of the format specified by the Record ID field. -
Constructor Summary
ConstructorsConstructorDescriptionConstructor creates and configures a new instance object -
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 bytesint
Getter forpadding
byte[]
Getter forpadTo64
short
Getter forrecordCount
Getter forrecordID
short
Getter forrecordLength
int
Getter forrecordSetSerialNumber
byte[]
Getter forrecordValues
int
hashCode()
void
marshal
(DataOutputStream dos) Serializes an object to a DataOutputStream.void
marshal
(ByteBuffer byteBuffer) Packs an object into the ByteBuffer.setPadding
(int pPadding) Setter forpadding
setPadTo64
(byte[] pPadTo64) Setter forpadTo64
setRecordCount
(int pRecordCount) Utility setter forrecordCount
setRecordCount
(short pRecordCount) Setter forrecordCount
setRecordID
(VariableRecordType pRecordID) Setter forrecordID
setRecordLength
(int pRecordLength) Utility setter forrecordLength
setRecordLength
(short pRecordLength) Setter forrecordLength
setRecordSetSerialNumber
(int pRecordSetSerialNumber) Setter forrecordSetSerialNumber
setRecordValues
(byte[] pRecordValues) Setter forrecordValues
toString()
int
unmarshal
(DataInputStream dis) Deserializes an object from a DataInputStream.int
unmarshal
(ByteBuffer byteBuffer) Unpacks a Pdu from the underlying data.
-
Field Details
-
recordID
The data structure used to convey the parameter values of the record for each record. 32-bit enumeration. uid = 66 -
recordSetSerialNumber
protected int recordSetSerialNumberThe serial number of the first record in the block of records -
padding
protected int paddingzero-filled array of padding bits for byte alignment and consistent sizing of PDU data -
recordLength
protected short recordLengththe length, in bits, of the record. Note, bits, not bytes. -
recordCount
protected short recordCountthe number of records included in the record set -
recordValues
protected byte[] recordValuesThe concatenated records of the format specified by the Record ID field. The length of this field is the Record Length multiplied by the Record Count, in units of bits. -
padTo64
protected byte[] padTo64used if required to make entire record size an even multiple of 8 bytes
-
-
Constructor Details
-
RecordSpecificationElement
public RecordSpecificationElement()Constructor creates and configures a new instance object
-
-
Method Details
-
getMarshalledSize
public int getMarshalledSize()Returns size of this serialized (marshalled) object in bytes- Returns:
- serialized size in bytes
- See Also:
-
setRecordID
Setter forrecordID
- Parameters:
pRecordID
- new value of interest- Returns:
- same object to permit progressive setters
-
getRecordID
-
setRecordSetSerialNumber
Setter forrecordSetSerialNumber
- Parameters:
pRecordSetSerialNumber
- new value of interest- Returns:
- same object to permit progressive setters
-
getRecordSetSerialNumber
-
setPadding
Setter forpadding
- Parameters:
pPadding
- new value of interest- Returns:
- same object to permit progressive setters
-
getPadding
-
setRecordLength
Setter forrecordLength
- Parameters:
pRecordLength
- new value of interest- Returns:
- same object to permit progressive setters
-
setRecordLength
Utility setter forrecordLength
- Parameters:
pRecordLength
- new value of interest- Returns:
- same object to permit progressive setters
-
getRecordLength
-
setRecordCount
Setter forrecordCount
- Parameters:
pRecordCount
- new value of interest- Returns:
- same object to permit progressive setters
-
setRecordCount
Utility setter forrecordCount
- Parameters:
pRecordCount
- new value of interest- Returns:
- same object to permit progressive setters
-
getRecordCount
-
setRecordValues
Setter forrecordValues
- Parameters:
pRecordValues
- new value of interest- Returns:
- same object to permit progressive setters
-
getRecordValues
-
setPadTo64
Setter forpadTo64
- Parameters:
pPadTo64
- new value of interest- Returns:
- same object to permit progressive setters
-
getPadTo64
-
marshal
Serializes an object to a DataOutputStream.- Parameters:
dos
- the OutputStream- Throws:
Exception
- if something goes wrong- See Also:
-
unmarshal
Deserializes an object from a DataInputStream.- Parameters:
dis
- the InputStream- Returns:
- marshalled serialized size in bytes
- Throws:
Exception
- if something goes wrong- See Also:
-
marshal
Packs an object into the ByteBuffer.- 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:
-
unmarshal
Unpacks a Pdu from the underlying data.- 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:
-
equals
-
equalsImpl
Compare all fields that contribute to the state, ignoring transient and static fields, forthis
and the supplied object- Parameters:
obj
- the object to compare to- Returns:
- true if the objects are equal, false otherwise.
-
toString
-
hashCode
-