|
||||||||||
| 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.UnsignedInteger
public final class UnsignedInteger
Unsigned Integer represents an integer number value between 0 .. and 0xFFFFFFFF.
There is a static instance for values between 0..1023 which can be accessed using
static methods valueOf(long) or getFromBits(int)
This class is immutable - once it has been constructed its value cannot be changed.
To use int as backend use toIntBits() and getFromBits(int).
| Field Summary | |
|---|---|
static long |
L_MAX_VALUE
Constant L_MAX_VALUE=0xFFFFFFFFL |
static long |
L_MIN_VALUE
Constant L_MIN_VALUE=0L |
static UnsignedInteger |
MAX_VALUE
Constant MAX_VALUE |
static UnsignedInteger |
MIN_VALUE
Constant MIN_VALUE |
static UnsignedInteger |
ONE
Constant ONE |
static UnsignedInteger |
ZERO
Constant ZERO |
| Constructor Summary | |
|---|---|
UnsignedInteger()
Constructor for UnsignedInteger. |
|
UnsignedInteger(int value)
Constructor for UnsignedInteger. |
|
UnsignedInteger(long value)
Constructor for UnsignedInteger. |
|
UnsignedInteger(String value)
Constructor for UnsignedInteger. |
|
UnsignedInteger(UnsignedByte value)
Constructor for UnsignedInteger. |
|
UnsignedInteger(UnsignedInteger value)
Constructor for UnsignedInteger. |
|
| Method Summary | |
|---|---|
UnsignedInteger |
add(int increment)
Add a value. |
UnsignedInteger |
add(long increment)
Add a value. |
UnsignedInteger |
add(UnsignedInteger increment)
Add a value. |
UnsignedInteger |
and(int value)
and. |
UnsignedInteger |
and(long value)
and. |
UnsignedInteger |
and(UnsignedInteger value)
and. |
byte |
byteValue()
|
int |
compareTo(Number o)
|
UnsignedInteger |
dec()
Decrease the value by one. |
double |
doubleValue()
|
boolean |
equals(Object obj)
|
float |
floatValue()
|
static UnsignedInteger |
getFromBits(int value)
getFromBits. |
long |
getValue()
Getter for the field value. |
int |
hashCode()
|
UnsignedInteger |
inc()
Increase the value by one. |
int |
intValue()
|
long |
longValue()
|
static UnsignedInteger |
max(UnsignedInteger v0,
UnsignedInteger v1)
max. |
static UnsignedInteger |
min(UnsignedInteger v0,
UnsignedInteger v1)
min. |
UnsignedInteger |
or(int value)
or. |
UnsignedInteger |
or(long value)
or. |
UnsignedInteger |
or(UnsignedInteger value)
or. |
static UnsignedInteger |
parseUnsignedInteger(String s)
Parse an UnsignedInteger value from a string |
static UnsignedInteger |
parseUnsignedInteger(String s,
int radix)
Parses the string argument as an unsigned integer similar to Integer.parseInt(String, int) |
UnsignedInteger |
subtract(int decrement)
Subtract a value from this value. |
UnsignedInteger |
subtract(long decrement)
Subtract a value from this value. |
UnsignedInteger |
subtract(UnsignedInteger decrement)
Subtract a value from this value. |
int |
toIntBits()
toIntBits. |
String |
toString()
|
static UnsignedInteger |
valueOf(long value)
valueOf. |
| Methods inherited from class java.lang.Number |
|---|
shortValue |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final long L_MAX_VALUE
L_MAX_VALUE=0xFFFFFFFFL
public static final long L_MIN_VALUE
L_MIN_VALUE=0L
public static final UnsignedInteger MAX_VALUE
MAX_VALUE
public static final UnsignedInteger MIN_VALUE
MIN_VALUE
public static final UnsignedInteger ZERO
ZERO
public static final UnsignedInteger ONE
ONE
| Constructor Detail |
|---|
public UnsignedInteger()
Constructor for UnsignedInteger.
public UnsignedInteger(int value)
throws IllegalArgumentException
Constructor for UnsignedInteger.
value - a int.
IllegalArgumentException - if any.
public UnsignedInteger(long value)
throws IllegalArgumentException
Constructor for UnsignedInteger.
value - a long.
IllegalArgumentException - if any.
public UnsignedInteger(String value)
throws IllegalArgumentException
Constructor for UnsignedInteger.
value - a String object.
IllegalArgumentException - if any.public UnsignedInteger(UnsignedInteger value)
Constructor for UnsignedInteger.
value - a UnsignedInteger object.public UnsignedInteger(UnsignedByte value)
Constructor for UnsignedInteger.
value - a UnsignedByte object.| Method Detail |
|---|
public static UnsignedInteger getFromBits(int value)
getFromBits.
value - a int.
UnsignedInteger object.public static UnsignedInteger valueOf(long value)
valueOf.
value - a long.
UnsignedInteger object.
public static UnsignedInteger max(UnsignedInteger v0,
UnsignedInteger v1)
max.
v0 - a UnsignedInteger object.v1 - a UnsignedInteger object.
UnsignedInteger object.
public static UnsignedInteger min(UnsignedInteger v0,
UnsignedInteger v1)
min.
v0 - a UnsignedInteger object.v1 - a UnsignedInteger object.
UnsignedInteger object.public long getValue()
Getter for the field value.
public byte byteValue()
byteValue in class Numberpublic double doubleValue()
doubleValue in class Numberpublic float floatValue()
floatValue in class Numberpublic int toIntBits()
toIntBits.
public int intValue()
intValue in class Numberpublic long longValue()
longValue in class Numberpublic int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Objectpublic String toString()
toString in class Objectpublic UnsignedInteger and(UnsignedInteger value)
and.
value - a UnsignedInteger object.
UnsignedInteger object.public UnsignedInteger and(int value)
and.
value - a int.
UnsignedInteger object.public UnsignedInteger and(long value)
and.
value - a long.
UnsignedInteger object.public UnsignedInteger or(UnsignedInteger value)
or.
value - a UnsignedInteger object.
UnsignedInteger object.public UnsignedInteger or(int value)
or.
value - a int.
UnsignedInteger object.public UnsignedInteger or(long value)
or.
value - a long.
UnsignedInteger object.public int compareTo(Number o)
compareTo in interface Comparable<Number>
public static UnsignedInteger parseUnsignedInteger(String s)
throws NumberFormatException,
IllegalArgumentException
s - the string to parse, assumed to contain a positive Long value
NumberFormatException - if the string cannot be parsed into an integer value
IllegalArgumentException - if the parsed value does not fit in the range of UnsignedInteger
public static UnsignedInteger parseUnsignedInteger(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 UnsignedInteger inc()
public UnsignedInteger dec()
IllegalArgumentException - if the value was 0 before the callpublic UnsignedInteger add(int increment)
increment - the value to add to the current value
public UnsignedInteger add(long increment)
increment - the value to add to the current value
public UnsignedInteger add(UnsignedInteger increment)
increment - the value to add to the current value
public UnsignedInteger subtract(int decrement)
decrement - the value to subtract from the current value
IllegalArgumentException - if the decrement is bigger than the current valuepublic UnsignedInteger subtract(long decrement)
decrement - the value to subtract from the current value
IllegalArgumentException - if the decrement is bigger than the current valuepublic UnsignedInteger subtract(UnsignedInteger 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 | |||||||||