Package edu.nps.moves.dis7.pdus
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 intzero-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 shortthe number of records included in the record setprotected VariableRecordTypeThe data structure used to convey the parameter values of the record for each record. 32-bit enumeration. uid = 66protected shortthe length, in bits, of the record.protected intThe 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 TypeMethodDescriptionbooleanbooleanequalsImpl(Object obj) Compare all fields that contribute to the state, ignoring transient and static fields, forthisand the supplied objectintReturns size of this serialized (marshalled) object in bytesintGetter forpaddingbyte[]Getter forpadTo64shortGetter forrecordCountGetter forrecordIDshortGetter forrecordLengthintGetter forrecordSetSerialNumberbyte[]Getter forrecordValuesinthashCode()voidmarshal(DataOutputStream dos) Serializes an object to a DataOutputStream.voidmarshal(ByteBuffer byteBuffer) Packs an object into the ByteBuffer.setPadding(int pPadding) Setter forpaddingsetPadTo64(byte[] pPadTo64) Setter forpadTo64setRecordCount(int pRecordCount) Utility setter forrecordCountsetRecordCount(short pRecordCount) Setter forrecordCountsetRecordID(VariableRecordType pRecordID) Setter forrecordIDsetRecordLength(int pRecordLength) Utility setter forrecordLengthsetRecordLength(short pRecordLength) Setter forrecordLengthsetRecordSetSerialNumber(int pRecordSetSerialNumber) Setter forrecordSetSerialNumbersetRecordValues(byte[] pRecordValues) Setter forrecordValuestoString()intunmarshal(DataInputStream dis) Deserializes an object from a DataInputStream.intunmarshal(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, forthisand the supplied object- Parameters:
obj- the object to compare to- Returns:
- true if the objects are equal, false otherwise.
-
toString
-
hashCode
-