Overview | Package | Class | Tree | Deprecated | Index | Help | |||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Number | +--mil.navy.nps.util.UnsignedShort
This implements the SerializationInterface, which means it can be written out to a stream in the standard DIS 32-bit format.
See explanation in UnsignedByte for how the mapping of negative-to-positive numbers works.
This implements the Cloneable interface, which means that when we clone() something we can do a bitwise field copy (shallow copy). This needs to change if we ever have any actual objects contained in this class.
Field Summary | |
static int | MAX_SHORT_VALUE
|
Constructor Summary | |
UnsignedShort()
Contructs an UnsignedShort object and intializes its value to 0. |
|
UnsignedShort(int pData)
Constructs a an UnsignedShort object from a signed int,
throws an exception if the parameter is out of range. |
|
UnsignedShort(short pData)
Constructs an UnsignedShort object from a signed short,
throws an exception if the parameter is out of range. |
|
UnsignedShort(long pData)
Constructs an UnsignedShort object from a signed long,
throws an exception if the parameter is out of range. |
Method Summary | |
java.lang.Object | clone()
Makes a deep copy of the current UnsignedShort object. |
void | debugTest()
Of debugging interest only. |
void | deSerialize(java.io.DataInputStream pInputStream)
Reads an UnsignedByte in from DIS format. |
double | doubleValue()
Returns the current value of this object as a double float, after conversion. |
boolean | equals(java.lang.Object obj)
|
float | floatValue()
Returns a the current value of this object as a float, after conversion. |
int | intValue()
Returns the current value of this object as an int, after conversion. |
long | longValue()
Returns the current value of this object as a long, after conversion. |
void | serialize(java.io.DataOutputStream pOutputStream)
Writes out a UnsignedShort to an output stream. |
java.lang.String | toString()
Returns a String object representing this UnsignedShort value. |
Methods inherited from class java.lang.Number | |
byteValue, doubleValue, floatValue, intValue, longValue, shortValue |
Methods inherited from class java.lang.Object | |
Field Detail |
public static final int MAX_SHORT_VALUE
Constructor Detail |
public UnsignedShort()
UnsignedShort
object and intializes its value to 0.public UnsignedShort(int pData)
UnsignedShort
object from a signed int,
throws an exception if the parameter is out of range.
pData
- >=0, <=MAX_SHORT_VALUEpData
is out of rangepublic UnsignedShort(short pData)
UnsignedShort
object from a signed short,
throws an exception if the parameter is out of range.
pData
- >=0pData
is out of rangepublic UnsignedShort(long pData)
UnsignedShort
object from a signed long,
throws an exception if the parameter is out of range.
pData
- >=0, <=MAX_SHORT_VALUEpData
is out of rangeMethod Detail |
public double doubleValue()
public float floatValue()
public long longValue()
public int intValue()
public void serialize(java.io.DataOutputStream pOutputStream)
outputstream
- the targetted output stream for this objectIOException
occurs.public void deSerialize(java.io.DataInputStream pInputStream)
inputstream
- the input stream that builds the object.IOException
occurs.public java.lang.String toString()
UnsignedShort
value.public java.lang.Object clone()
UnsignedShort
object.public boolean equals(java.lang.Object obj)
public void debugTest()
Overview | Package | Class | Tree | Deprecated | Index | Help | |||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |