Class mil.navy.nps.dis.CommentPdu
java.lang.Object
|
+--mil.navy.nps.dis.PduElement
|
+--mil.navy.nps.dis.ProtocolDataUnit
|
+--mil.navy.nps.dis.SimulationManagementPdu
|
+--mil.navy.nps.dis.CommentPdu
- public class CommentPdu
- extends SimulationManagementPdu
- Version:
- 1.0
- Author:
- Don McGregor (http://www.stl.nps.navy.mil/~mcgredo)
- Location:
-
http://www.stl.nps.navy.mil/dis-java-vrml/mil/navy/nps/dis/CommentPdu.java
- Hierarchy Diagram:
- Summary:
- The CommentPdu is used to send arbitrary messages, such
as character strings.
- Explanation:
- The specificatrion says: "Arbitrary messages (character strings, for example) shall be entered
into data stream by using a Comment PDU".
This has a header section, which is
inherited from the Simulation management PDU abstract class
which contains the header information. After that, the
PDU consists of counts of the number of fixed and variable
datum records, and the records themselves.
The commentPDU will be implemented using the Datum Specification
record despite it does not have one. The thing is it has an amputated
part of it. It has a Datum Specification with no Fixed Datum data fields.
So we are going to use the Datum Specification with proper care to
ensure that will not ever exist in this PDU Fixed Datum values.
IF modification are done, pay atention to setDatumSpecification method,
because it is reponsible for maintaining this integrity, and is a little
bit different from other classes accessor methods.
- Note:
- Here we implement a datumSpecification instead of the Number of Variable Datum fields
and the variable Datum Record as in the specification.
- History:
- 09Dec96 /Don McGregor /New
- 10Mar97 /Don McGregor /Cleaned up for javadoc
- 16Apr97 /Don McGregor /PrintStream passed to printValues
- 06May97 /Don McGregor /Bug fixed in deSerialize; attempting to get int value of unsigned
- int, also a stray semicolon at end of for statement.
- 16Sep97 /Antonio Alexandre Rua /header inherited from Simulation Management+use setDatumSpecification
- 8Dec97 /Ronan Fauglas /changes for documentation templates + complements in documentation
- 11Dec97 /Ronan Fauglas /changed access methods: thisVariable() --> getThisVariable()
- 5jan98 /Ronan Fauglas /changed DatumSpecification to protected.
- References:
- DIS-Java-VRML Working Group:
http://www.stl.nps.navy.mil/dis-java-vrml/
- DIS Data Dictionary :
Comment PDU
- DIS specification : IEEE 1278.1, 5.4.6.12, 4.4.5.4.12
- See Also:
- ProtocolDataUnit, PduElement, mil.navy.nps.util.SerializationInterface, DatatumSpecification, CreateEntityPdu, RemoveEntityPdu, StartResumePdu, StopFreezePdu, AcknowledgePdu, ActionRequestPdu, ActionResponsePdu, DataQueryPdu, SetDataPdu, DataPdu, EventReportPdu, CommentPdu
Field Summary
|
DatumSpecification
|
datumSpecification
This represents represents the number of fixed datum,
the number of variable datum, and the variable datum values.
|
static CommentPdu
|
exemplar
An "exemplar" object, which is filled out to the state that is needed most of the time.
|
Constructor Summary
|
CommentPdu()
Default constructor--fills with zeros for all values. |
Methods inherited from class mil.navy.nps.dis.ProtocolDataUnit |
, clone, datagramToPdu, deSerialize, getExerciseID, getPduType, getProtocolFamily, getProtocolVersion, getTimestamp, getVRMLTimestamp, length, makeTimestampCurrent, PDUName, printValues, serialize, setExerciseID, setExerciseID, setPduType, setPduType, setProtocolFamily, setProtocolFamily, setProtocolVersion, setProtocolVersion, setSimulationStartTime, setTimestamp, setTimestamp |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait |
datumSpecification
protected DatumSpecification datumSpecification
- This represents represents the number of fixed datum,
the number of variable datum, and the variable datum values.
Note: This is actually a truncated datum specification record
where we don't make use of the fixed datum record.
exemplar
protected static CommentPdu exemplar
- An "exemplar" object, which is filled out to the state that is needed most of the time.
- Explanation
- A brand new object has to have most of its values set,
such as the forceID, protocol version, and so on. This lets the user fill
out most of the values, save it in the class, then retrieve a copy of it
as needed.
CommentPdu
public CommentPdu()
- Default constructor--fills with zeros for all values.
PDUName
public java.lang.String PDUName()
- Overrides:
- PDUName in class SimulationManagementPdu
serialize
public void serialize(java.io.DataOutputStream outputStream)
- Overrides:
- serialize in class SimulationManagementPdu
deSerialize
public void deSerialize(java.io.DataInputStream inputStream)
- Overrides:
- deSerialize in class SimulationManagementPdu
clone
public java.lang.Object clone()
- Overrides:
- clone in class SimulationManagementPdu
length
public int length()
- Overrides:
- length in class SimulationManagementPdu
printValues
public void printValues(int indentLevel,
java.io.PrintStream printStream)
- Overrides:
- printValues in class SimulationManagementPdu
getExemplar
public CommentPdu getExemplar()
setExemplar
public void setExemplar(CommentPdu newExemplar)
getDatumSpecification
public DatumSpecification getDatumSpecification()
setDatumSpecification
public void setDatumSpecification(DatumSpecification pDatumSpecification)
- Note: the fixed List is automatically suppressed by the method.