|
||||||||||
| 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.DatumSpecification
Grouped datum information.
Note that our implementation might seem quite different from the representation of a Datum Specification Record in the DIS format, in fact we take advantage of the power of java where we can use elaborate structures "transparently". As with other things, the DatumSpecification record has to know how to serialize and deserialize itself, clone itself, and print out its values.
ProtocolDataUnit,
PduElement,
SerializationInterface| Field Summary | |
protected java.util.Vector |
fixedDatumList
Elaborate structure that represents the list of fixed datums. |
static int |
sizeOf
Constant value--size of a fixed data of the Datum Specification record (actually the 2 counters); here : sizeOf = 8 bytes. |
protected java.util.Vector |
variableDatumList
Elaborate structure that represents the list of variable datums. |
| Constructor Summary | |
DatumSpecification()
Default constructor. |
|
| Method Summary | |
void |
addFixedDatum(FixedDatum pDatum)
Adds the specified component to the end of this Fixed Datum list, increasing its size by one. |
void |
addVariableDatum(VariableDatum pDatum)
Adds the specified component to the end of this Variable Datum list, increasing its size by one. |
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. |
void |
dropFixedDatum()
Supress the existing Fixed Datum List (used in Comment PDU). |
void |
dropVariableDatum()
Supress the existing Fixed Datum List. |
FixedDatum |
fixedDatumAt(int pIdx)
Gets the specified component to the end at the specified index of the Fixed Datum List. |
int |
getFixedDatumCount()
|
int |
getVariableDatumCount()
|
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. |
VariableDatum |
variableDatumAt(int pIdx)
Gets the specified component to the end at the specified index of the Variable Datum List. |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.util.Vector fixedDatumList
protected java.util.Vector variableDatumList
public static final int sizeOf
sizeOf = 8 bytes.
| Constructor Detail |
public DatumSpecification()
| Method Detail |
public void serialize(java.io.DataOutputStream outputStream)
PduElementsuper.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 SerializationInterfaceserialize in class PduElementoutputStream - the stream to which this object is serializedpublic void deSerialize(java.io.DataInputStream inputStream)
PduElementsuper.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 SerializationInterfacedeSerialize in class PduElementinputStream - the stream from which this object is initializedpublic java.lang.Object clone()
PduElement
clone in class PduElementObjectpublic int length()
PduElement
length in class PduElement
public void printValues(int indentLevel,
java.io.PrintStream printStream)
PduElement
printValues in class PduElementindentLevel - number of spaces to indent for visibilitypublic int getFixedDatumCount()
public int getVariableDatumCount()
public void addFixedDatum(FixedDatum pDatum)
pDatum - the Datum to be inserted in the list.public FixedDatum fixedDatumAt(int pIdx)
pIdx - the index we want to get the value of.public void dropFixedDatum()
CommentPdupublic void addVariableDatum(VariableDatum pDatum)
pDatum - the Datum to be inserted in the list.public VariableDatum variableDatumAt(int pIdx)
pIdx - the index we want to get the value of.public void dropVariableDatum()
CommentPdu
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||