|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmil.navy.nps.dis.PduElement
mil.navy.nps.dis.EventID
Record for event identification.
Note that I've flattened the object, such that the site and application ID are in this object, rather than in an object/class of their own. This is a questionable move.
It inherits from PduElement, the abstract class that all non-PDUs inherit from. As usual, it knows how to serialize and deserialize itself, clone itself, etc.
The event ID is used to keep events straight. It is employed in the fire and detonation PDUs, for example.
This is extremely similar to the EventID class. It includes a hash function for the object, in case we want to use this as a key in a hash table.
PduElement
,
SerializationInterface
,
EntityStatePdu
Field Summary | |
protected UnsignedShort |
applicationID
Application Identifier Field - Each simulation application at a DIS site shall be assigned an application identifier unique within that site. |
protected UnsignedShort |
eventID
Event Indentifier Field - A general purpose Identifier used to uniquely identify up to 65535 items. |
protected UnsignedShort |
siteID
Site Identifier Field - Each DIS site shall be assigned a unique Site Identifier. |
protected static int |
sizeOf
Constant value--size of an EventID as written out to the wire. |
Constructor Summary | |
EventID()
Default constructor--fills with zeros for all values. |
|
EventID(short pSiteID,
short pApplicationID,
short pEventID)
|
Method Summary | |
java.lang.Object |
clone()
Makes deep copies of all the instance variables, so we don't have two objects pointing to the same data. |
void |
deSerialize(java.io.DataInputStream inputStream)
Deserialize our data from the input stream. |
boolean |
equals(java.lang.Object obj)
Makes a "numeric equality" test. |
UnsignedShort |
getApplicationID()
|
UnsignedShort |
getEventID()
|
UnsignedShort |
getSiteID()
|
int |
hashCode()
This provides a hash code for the object. |
int |
length()
Returns the length of the object when serialized in a stream. |
void |
printValues(int indentLevel,
java.io.PrintStream printStream)
Prints the generated serialized object for debugging. |
void |
serialize(java.io.DataOutputStream outputStream)
Serialize our data out to the stream. |
void |
setApplicationID(int pApplicationID)
|
void |
setApplicationID(UnsignedShort pApplicationID)
|
void |
setEventID(int pEventID)
|
void |
setEventID(UnsignedShort pEventID)
|
void |
setSiteID(int pSiteID)
|
void |
setSiteID(UnsignedShort pSiteID)
|
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected UnsignedShort siteID
protected UnsignedShort applicationID
protected UnsignedShort eventID
protected static final int sizeOf
sizeOf = 6 bytes
Constructor Detail |
public EventID()
public EventID(short pSiteID, short pApplicationID, short pEventID)
Method Detail |
public java.lang.Object clone()
PduElement
clone
in class PduElement
Object
public void serialize(java.io.DataOutputStream outputStream)
PduElement
super.Serialize()
to make sure
the superclasse's data is serialized out. The order
in which instance variables are serialized is significant. They must
be serialized in the same order they appear in the DIS
spec.
Prints out some information during execution if debugging flag is set.
serialize
in interface SerializationInterface
serialize
in class PduElement
outputStream
- the stream to which this object is serializedpublic void deSerialize(java.io.DataInputStream inputStream)
PduElement
super.deSerialize
to make sure
the superclass's data are properly affected. The order
in which instance variables are serialized is significant. They must
be deSerialized in the same order as they have been serialized as specified by the DIS spec.
deSerialize
in interface SerializationInterface
deSerialize
in class PduElement
inputStream
- the stream from which this object is initializedpublic int length()
PduElement
length
in class PduElement
public void printValues(int indentLevel, java.io.PrintStream printStream)
PduElement
printValues
in class PduElement
indentLevel
- number of spaces to indent for visibilitypublic int hashCode()
EntityID.hashCode()
public boolean equals(java.lang.Object obj)
obj
- the object want to be compared with this object.
public UnsignedShort getSiteID()
public void setSiteID(UnsignedShort pSiteID)
public void setSiteID(int pSiteID)
public UnsignedShort getApplicationID()
public void setApplicationID(UnsignedShort pApplicationID)
public void setApplicationID(int pApplicationID)
public UnsignedShort getEventID()
public void setEventID(UnsignedShort pEventID)
public void setEventID(int pEventID)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |