Class RecordSpecificationElement

java.lang.Object
edu.nps.moves.dis7.pdus.RecordSpecificationElement
All Implemented Interfaces:
Serializable

public class RecordSpecificationElement extends Object implements 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 Details

    • recordID

      protected VariableRecordType recordID
      The data structure used to convey the parameter values of the record for each record. 32-bit enumeration. uid = 66
    • recordSetSerialNumber

      protected int recordSetSerialNumber
      The serial number of the first record in the block of records
    • padding

      protected int padding
      zero-filled array of padding bits for byte alignment and consistent sizing of PDU data
    • recordLength

      protected short recordLength
      the length, in bits, of the record. Note, bits, not bytes.
    • recordCount

      protected short recordCount
      the number of records included in the record set
    • recordValues

      protected byte[] recordValues
      The 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[] padTo64
      used 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

      public RecordSpecificationElement setRecordID(VariableRecordType pRecordID)
      Setter for recordID
      Parameters:
      pRecordID - new value of interest
      Returns:
      same object to permit progressive setters
    • getRecordID

      public VariableRecordType getRecordID()
      Getter for recordID
      Returns:
      value of interest
    • setRecordSetSerialNumber

      public RecordSpecificationElement setRecordSetSerialNumber(int pRecordSetSerialNumber)
      Parameters:
      pRecordSetSerialNumber - new value of interest
      Returns:
      same object to permit progressive setters
    • getRecordSetSerialNumber

      public int getRecordSetSerialNumber()
      Returns:
      value of interest
    • setPadding

      public RecordSpecificationElement setPadding(int pPadding)
      Setter for padding
      Parameters:
      pPadding - new value of interest
      Returns:
      same object to permit progressive setters
    • getPadding

      public int getPadding()
      Getter for padding
      Returns:
      value of interest
    • setRecordLength

      public RecordSpecificationElement setRecordLength(short pRecordLength)
      Setter for recordLength
      Parameters:
      pRecordLength - new value of interest
      Returns:
      same object to permit progressive setters
    • setRecordLength

      public RecordSpecificationElement setRecordLength(int pRecordLength)
      Utility setter for recordLength
      Parameters:
      pRecordLength - new value of interest
      Returns:
      same object to permit progressive setters
    • getRecordLength

      public short getRecordLength()
      Getter for recordLength
      Returns:
      value of interest
    • setRecordCount

      public RecordSpecificationElement setRecordCount(short pRecordCount)
      Setter for recordCount
      Parameters:
      pRecordCount - new value of interest
      Returns:
      same object to permit progressive setters
    • setRecordCount

      public RecordSpecificationElement setRecordCount(int pRecordCount)
      Utility setter for recordCount
      Parameters:
      pRecordCount - new value of interest
      Returns:
      same object to permit progressive setters
    • getRecordCount

      public short getRecordCount()
      Getter for recordCount
      Returns:
      value of interest
    • setRecordValues

      public RecordSpecificationElement setRecordValues(byte[] pRecordValues)
      Setter for recordValues
      Parameters:
      pRecordValues - new value of interest
      Returns:
      same object to permit progressive setters
    • getRecordValues

      public byte[] getRecordValues()
      Getter for recordValues
      Returns:
      value of interest
    • setPadTo64

      public RecordSpecificationElement setPadTo64(byte[] pPadTo64)
      Setter for padTo64
      Parameters:
      pPadTo64 - new value of interest
      Returns:
      same object to permit progressive setters
    • getPadTo64

      public byte[] getPadTo64()
      Getter for padTo64
      Returns:
      value of interest
    • marshal

      public void marshal(DataOutputStream dos) throws Exception
      Serializes an object to a DataOutputStream.
      Parameters:
      dos - the OutputStream
      Throws:
      Exception - if something goes wrong
      See Also:
    • unmarshal

      public int unmarshal(DataInputStream dis) throws Exception
      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

      public void marshal(ByteBuffer byteBuffer) throws Exception
      Packs an object into the ByteBuffer.
      Parameters:
      byteBuffer - The ByteBuffer at the position to begin writing
      Throws:
      BufferOverflowException - if byteBuffer is too small
      ReadOnlyBufferException - if byteBuffer is read only
      Exception - ByteBuffer-generated exception
      See Also:
    • unmarshal

      public int unmarshal(ByteBuffer byteBuffer) throws Exception
      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 small
      Exception - ByteBuffer-generated exception
      See Also:
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • equalsImpl

      public boolean equalsImpl(Object obj)
      Compare all fields that contribute to the state, ignoring transient and static fields, for this and the supplied object
      Parameters:
      obj - the object to compare to
      Returns:
      true if the objects are equal, false otherwise.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object