|
||||||||||
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.VariableDatum
Variable-length data.
The VariableDatum is used in a variety of places, most notably the DataPdu.
This inherits from PduElement, which means that it must know how to serialize, deSerialize, clone, print its values, and determine its length when serialized.
PduElement
,
SerializationInterface
,
DataPdu
Field Summary | |
static int |
sizeOf
Constant value--size of an empty object WHEN WRITTEN TO THE WIRE; here : sizeOf = 8 bytes . |
(package private) int |
variableDatumID
The Variable Datum ID shall be represented by a 32-bit enumeration. |
(package private) int |
variableDatumLength
This field shall specify the length of the variable datum in bits. |
(package private) long[] |
variableDatumValue
These field(s) shall store the value of the variable datum defined by the Variable Datum ID and Variable Datum length. |
Constructor Summary | |
VariableDatum()
Default constructor--fills with zeros for all values. |
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. |
int |
getVariableDatumID()
|
int |
getVariableDatumLength()
|
long[] |
getVariableDatumValue()
|
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 |
setVariableDatumID(int pVariableDatumID)
|
void |
setVariableDatumLength(int pVariableDatumLength)
|
void |
setVariableDatumValue(long[] pVariableDatumValue)
|
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
int variableDatumID
int variableDatumLength
long[] variableDatumValue
public static final int sizeOf
sizeOf = 8 bytes
.
Constructor Detail |
public VariableDatum()
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 serialized
java.lang.RuntimeException
- when IO error occurs.public 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 initialized
java.lang.RuntimeException
- when IO error occurs.public 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 getVariableDatumID()
public void setVariableDatumID(int pVariableDatumID)
public int getVariableDatumLength()
public void setVariableDatumLength(int pVariableDatumLength)
public long[] getVariableDatumValue()
java.lang.RuntimeException
- if Index error occurs while copying array
java.lang.RuntimeException
- if error occurs while copying array.public void setVariableDatumValue(long[] pVariableDatumValue)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |