Class EntityID

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

public class EntityID extends Object implements Serializable
Unique identifier triplet for this entity. Also referred to as EntityIdentifier
See Also:
  • Field Details

    • siteID

      protected short siteID
      Site ID values are unique identification number for originating site, often corresponding to an internet address. Site ID values are agreed upon by individual simulations.
    • applicationID

      protected short applicationID
      Application ID values are unique identification number for originating application at a given site. Application ID values are sssigned by individual sites.
    • entityID

      protected short entityID
      Entity ID values are unique identification number for s givent entity in the originating application at a given site. Entity ID values are sssigned by individual simulation programs.
  • Constructor Details

    • EntityID

      public EntityID()
      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:
    • setSiteID

      public EntityID setSiteID(short pSiteID)
      Setter for siteID
      Parameters:
      pSiteID - new value of interest
      Returns:
      same object to permit progressive setters
    • setSiteID

      public EntityID setSiteID(int pSiteID)
      Utility setter for siteID
      Parameters:
      pSiteID - new value of interest
      Returns:
      same object to permit progressive setters
    • getSiteID

      public short getSiteID()
      Getter for siteID
      Returns:
      value of interest
    • setApplicationID

      public EntityID setApplicationID(short pApplicationID)
      Setter for applicationID
      Parameters:
      pApplicationID - new value of interest
      Returns:
      same object to permit progressive setters
    • setApplicationID

      public EntityID setApplicationID(int pApplicationID)
      Utility setter for applicationID
      Parameters:
      pApplicationID - new value of interest
      Returns:
      same object to permit progressive setters
    • getApplicationID

      public short getApplicationID()
      Getter for applicationID
      Returns:
      value of interest
    • setEntityID

      public EntityID setEntityID(short pEntityID)
      Setter for entityID
      Parameters:
      pEntityID - new value of interest
      Returns:
      same object to permit progressive setters
    • setEntityID

      public EntityID setEntityID(int pEntityID)
      Utility setter for entityID
      Parameters:
      pEntityID - new value of interest
      Returns:
      same object to permit progressive setters
    • getEntityID

      public short getEntityID()
      Getter for entityID
      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