|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Number
org.opcfoundation.ua.builtintypes.UnsignedLong
public final class UnsignedLong
Unsigned Long represents an integer number value between 0 .. and 0xFFFFFFFFFFFFFFFF.
There is a static instance for values between 0..1023 which can be accessed using
static methods valueOf(long) or getFromBits(long)
This class is immutable - once it has been constructed its value cannot be changed.
To use int as backend use toLongBits() and getFromBits(long).
| Field Summary | |
|---|---|
static NodeId |
ID
Constant ID |
static UnsignedLong |
MAX_VALUE
Constant MAX_VALUE |
static UnsignedLong |
MIN_VALUE
Constant MIN_VALUE |
static UnsignedLong |
ONE
Constant ONE |
static int |
SIZE
Constant SIZE=64 |
static UnsignedLong |
ZERO
Constant ZERO |
| Constructor Summary | |
|---|---|
UnsignedLong(BigInteger value)
Constructor for UnsignedLong. |
|
UnsignedLong(int value)
Constructor for UnsignedLong. |
|
UnsignedLong(long value)
Construct UnsignedLong from long. |
|
UnsignedLong(String value)
Constructor for UnsignedLong. |
|
| Method Summary | |
|---|---|
UnsignedLong |
add(long increment)
Add a value. |
UnsignedLong |
add(UnsignedLong increment)
Add a value. |
BigInteger |
bigIntegerValue()
bigIntegerValue. |
int |
compareTo(Number o)
compareTo. |
UnsignedLong |
dec()
Decrease the value by one. |
double |
doubleValue()
|
boolean |
equals(Object obj)
|
float |
floatValue()
|
static UnsignedLong |
getFromBits(long bits)
Create unsigned long from 64 bits |
int |
hashCode()
|
UnsignedLong |
inc()
Increase the value by one. |
int |
intValue()
|
long |
longValue()
|
static UnsignedLong |
parseUnsignedLong(String s)
Parse an UnsignedLong value from a string |
static UnsignedLong |
parseUnsignedLong(String s,
int radix)
Parses the string argument as an unsigned long similar to Integer.parseInt(String, int) |
UnsignedLong |
subtract(long decrement)
Subtract a value from this value. |
UnsignedLong |
subtract(UnsignedLong decrement)
Subtract a value from this value. |
long |
toLongBits()
toLongBits. |
String |
toString()
|
static UnsignedLong |
valueOf(long value)
Get cached or create new instance |
| Methods inherited from class java.lang.Number |
|---|
byteValue, shortValue |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final NodeId ID
ID
public static final int SIZE
SIZE=64
public static final UnsignedLong MAX_VALUE
MAX_VALUE
public static final UnsignedLong MIN_VALUE
MIN_VALUE
public static final UnsignedLong ZERO
ZERO
public static final UnsignedLong ONE
ONE
| Constructor Detail |
|---|
public UnsignedLong(BigInteger value)
throws IllegalArgumentException
Constructor for UnsignedLong.
value - a BigInteger object.
IllegalArgumentException - if any.public UnsignedLong(int value)
Constructor for UnsignedLong.
value - a int.public UnsignedLong(long value)
value - a long.public UnsignedLong(String value)
Constructor for UnsignedLong.
value - a String object.| Method Detail |
|---|
public static UnsignedLong getFromBits(long bits)
bits - a long.
public static UnsignedLong valueOf(long value)
value - a long.
public BigInteger bigIntegerValue()
bigIntegerValue.
BigInteger object.public double doubleValue()
doubleValue in class Numberpublic float floatValue()
floatValue in class Numberpublic int intValue()
intValue in class Numberpublic long longValue()
longValue in class Numberpublic int compareTo(Number o)
compareTo.
compareTo in interface Comparable<Number>o - a Number object.
public boolean equals(Object obj)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String toString()
toString in class Objectpublic long toLongBits()
toLongBits.
public static UnsignedLong parseUnsignedLong(String s)
s - the string to parse, assumed to contain a positive Long value
public static UnsignedLong parseUnsignedLong(String s,
int radix)
throws NumberFormatException,
IllegalArgumentException
Integer.parseInt(String, int)
s - the string to parse, assumed to contain a positive Long valueradix - the radix to be used while parsing s.
NumberFormatException - if the string cannot be parsed into an integer value
IllegalArgumentException - if the parsed value does not fit in the range of UnsignedIntegerpublic UnsignedLong inc()
public UnsignedLong dec()
IllegalArgumentException - if the value was 0 before the callpublic UnsignedLong add(long increment)
increment - the value to add to the current value
public UnsignedLong add(UnsignedLong increment)
increment - the value to add to the current value
public UnsignedLong subtract(long decrement)
decrement - the value to subtract from the current value
IllegalArgumentException - if the decrement is bigger than the current valuepublic UnsignedLong subtract(UnsignedLong decrement)
decrement - the value to subtract from the current value
IllegalArgumentException - if the decrement is bigger than the current value
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||