Class StandardVariableSpecification

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

public class StandardVariableSpecification extends Object implements Serializable
Does not work, and causes failure in anything it is embedded in. Section 6.2.83 IEEE Std 1278.1-2012, IEEE Standard for Distributed Interactive Simulation - Application Protocols
See Also:
Serialized Form
  • Field Details

    • numberOfStandardVariableRecords

      protected short numberOfStandardVariableRecords
      Number of static variable records
    • standardVariables

      protected List<StandardVariableRecord> standardVariables
      variable length list of standard variables, The class type and length here are WRONG and will cause the incorrect serialization of any class in whihc it is embedded.
  • Constructor Details

    • StandardVariableSpecification

      public StandardVariableSpecification()
      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:
      https://en.wikipedia.org/wiki/Marshalling_(computer_science)
    • getNumberOfStandardVariableRecords

      public short getNumberOfStandardVariableRecords()
      Utility method to get size of field
      Returns:
      size of field
    • setNumberOfStandardVariableRecords

      public StandardVariableSpecification setNumberOfStandardVariableRecords(short pNumberOfStandardVariableRecords)
      Note that setting this value will not change the marshalled value. The list whose length this describes is used for that purpose. The getnumberOfStandardVariableRecords method will also be based on the actual list length rather than this value. The method is simply here for java bean completeness.
      Parameters:
      pNumberOfStandardVariableRecords - passed parameter
      Returns:
      this object
    • setStandardVariables

      public StandardVariableSpecification setStandardVariables(List<StandardVariableRecord> pStandardVariables)
      Parameters:
      pStandardVariables - new value of interest
      Returns:
      same object to permit progressive setters
    • getStandardVariables

      public List<StandardVariableRecord> getStandardVariables()
      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:
      DataOutputStream
    • 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:
      DataInputStream, https://en.wikipedia.org/wiki/Marshalling_(computer_science)
    • 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:
      ByteBuffer
    • 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:
      ByteBuffer, https://en.wikipedia.org/wiki/Marshalling_(computer_science)
    • 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