|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Number
mil.navy.nps.util.UnsignedLong
This implements the SerializationInterface, which means it can be written out to a stream in the standard DIS 64-bit format.
See comments in UnsignedByte for description of how the mapping between negative values and unsigned positive values 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.
java mil.navy.nps.util.UnsignedLong
SerializationInterface
,
UnsignedByte
,
UnsignedShort
,
UnsignedInt
,
Serialized FormField Summary | |
static long |
MAX_UNSIGNEDLONG_VALUE
Maximum value is (2^64 - 1) = 18446744073709551615, but currently support is limited to 63-bit maximum size of Long = java.lang.Long.MAX_VALUE |
Constructor Summary | |
UnsignedLong()
Contructs an UnsignedLong object and initializes its value to 0. |
|
UnsignedLong(byte pData)
Constructs a UnsignedLong object from a signed byte,
throws an exception if the parameter is out of range. |
|
UnsignedLong(double pData)
Constructs an UnsignedLong object from a signed double,
throws an exception if the parameter is out of range. |
|
UnsignedLong(float pData)
Constructs an UnsignedLong object from a signed float,
throws an exception if the parameter is out of range. |
|
UnsignedLong(int pData)
Constructs an UnsignedLong object from a signed int,
throws an exception if the parameter is out of range. |
|
UnsignedLong(long pData)
Constructs an UnsignedLong object from a signed long,
throws an exception if the parameter is out of range. |
|
UnsignedLong(short pData)
Constructs a UnsignedLong object from a signed short,
throws an exception if the paraneter is out of range. |
Method Summary | |
java.lang.Object |
clone()
Makes a deep copy of the current UnsignedLong object. |
static void |
debugTest()
Of debugging interest only. |
void |
deSerialize(java.io.DataInputStream pInputStream)
Reads an UnsignedLong input from DIS format. |
double |
doubleValue()
Returns the current value of this object as a double float, after conversion. |
float |
floatValue()
Returns a the current value of this object as a float, after conversion. |
int |
intValue()
Don't use this ! Explanation This is actually a bad thing, since we cannot represent the full range of an unsigned long with an long. |
long |
longValue()
Returns the current value of this object as a long, after conversion. |
static void |
main(java.lang.String[] args)
|
void |
serialize(java.io.DataOutputStream pOutputStream)
Writes out an UnsignedLong to an output stream. |
java.lang.String |
toString()
Returns a String object representing this UnsignedLong value. |
Methods inherited from class java.lang.Number |
byteValue, shortValue |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final long MAX_UNSIGNEDLONG_VALUE
Constructor Detail |
public UnsignedLong()
UnsignedLong
object and initializes its value to 0.
public UnsignedLong(byte pData)
UnsignedLong
object from a signed byte,
throws an exception if the parameter is out of range.
pData
- >=0,<=MAX_UNSIGNEDLONG_VALUE
java.lang.RuntimeException
- if pData
is out of rangepublic UnsignedLong(short pData)
UnsignedLong
object from a signed short,
throws an exception if the paraneter is out of range.
pData
- >=0
java.lang.RuntimeException
- if pData
is out of rangepublic UnsignedLong(int pData)
UnsignedLong
object from a signed int,
throws an exception if the parameter is out of range.
pData
- >=0
java.lang.RuntimeException
- if pData
is out of rangepublic UnsignedLong(double pData)
UnsignedLong
object from a signed double,
throws an exception if the parameter is out of range.
pData
- >=0
java.lang.RuntimeException
- if pData
is out of rangepublic UnsignedLong(float pData)
UnsignedLong
object from a signed float,
throws an exception if the parameter is out of range.
pData
- >=0
java.lang.RuntimeException
- if pData
is out of rangepublic UnsignedLong(long pData)
UnsignedLong
object from a signed long,
throws an exception if the parameter is out of range.
pData
- >=0
java.lang.RuntimeException
- if pData
is out of rangeMethod Detail |
public float floatValue()
public double doubleValue()
public long longValue()
public int intValue()
java.lang.RuntimeException
- whenever one tries to use this method.public void serialize(java.io.DataOutputStream pOutputStream)
serialize
in interface SerializationInterface
java.lang.RuntimeException
- if an IOException
occurs.SerializationInterface
public void deSerialize(java.io.DataInputStream pInputStream)
deSerialize
in interface SerializationInterface
java.lang.RuntimeException
- if an IOException
occurs.SerializationInterface
public java.lang.String toString()
UnsignedLong
value.
public java.lang.Object clone()
UnsignedLong
object.
java.lang.RuntimeException
- if cloning failspublic static void debugTest()
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |