|
||||||||||
| 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.UnsignedShort
public final class UnsignedShort
Unsigned Short represents an integer number value between 0 .. and 0xFFFF.
There is a static instance for values between 0..1023 which can be accessed
using static methods valueOf(int) or
getFromBits(short)
This class is immutable.
To create UnsignedShort from an integer value use
toShortBits() and
getFromBits(short).
| Field Summary | |
|---|---|
static NodeId |
ID
Constant ID |
static long |
L_MAX_VALUE
Constant L_MAX_VALUE=0xFFFFL |
static long |
L_MIN_VALUE
Constant L_MIN_VALUE=0L |
static UnsignedShort |
MAX_VALUE
Constant MAX_VALUE |
static UnsignedShort |
MIN_VALUE
Constant MIN_VALUE |
static UnsignedShort |
ONE
Constant ONE |
static UnsignedShort |
ZERO
Constant ZERO |
| Constructor Summary | |
|---|---|
UnsignedShort()
Constructor for UnsignedShort. |
|
UnsignedShort(int value)
Constructor for UnsignedShort. |
|
UnsignedShort(Number value)
Constructor for UnsignedShort. |
|
UnsignedShort(short value)
Constructor for UnsignedShort. |
|
UnsignedShort(String value)
Constructor for UnsignedShort. |
|
| Method Summary | |
|---|---|
UnsignedShort |
add(int increment)
Add a value. |
UnsignedShort |
add(UnsignedShort increment)
Add a value. |
byte |
byteValue()
|
int |
compareTo(UnsignedShort o)
compareTo. |
UnsignedShort |
dec()
Decrease the value by one. |
double |
doubleValue()
|
boolean |
equals(Object obj)
|
float |
floatValue()
|
static UnsignedShort |
getFromBits(short value)
getFromBits. |
int |
getValue()
Getter for the field value. |
int |
hashCode()
|
UnsignedShort |
inc()
Increase the value by one. |
int |
intValue()
|
long |
longValue()
|
static UnsignedShort |
max(UnsignedShort v0,
UnsignedShort v1)
max. |
static UnsignedShort |
min(UnsignedShort v0,
UnsignedShort v1)
min. |
static UnsignedShort |
parseUnsignedShort(String s)
Parse an UnsignedShort value from a string |
static UnsignedShort |
parseUnsignedShort(String s,
int radix)
Parses the string argument as an unsigned byte similar to Integer.parseInt(String, int) |
short |
shortValue()
|
UnsignedShort |
subtract(int decrement)
Subtract a value from this value. |
UnsignedShort |
subtract(UnsignedShort decrement)
Subtract a value from this value. |
short |
toShortBits()
toShortBits. |
String |
toString()
|
static UnsignedShort |
valueOf(int value)
valueOf. |
| 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 long L_MAX_VALUE
L_MAX_VALUE=0xFFFFL
public static final long L_MIN_VALUE
L_MIN_VALUE=0L
public static final UnsignedShort MAX_VALUE
MAX_VALUE
public static final UnsignedShort MIN_VALUE
MIN_VALUE
public static final UnsignedShort ZERO
ZERO
public static final UnsignedShort ONE
ONE
| Constructor Detail |
|---|
public UnsignedShort()
Constructor for UnsignedShort.
public UnsignedShort(short value)
Constructor for UnsignedShort.
value - a short.
public UnsignedShort(int value)
throws IllegalArgumentException
Constructor for UnsignedShort.
value - a int.
IllegalArgumentException - if any.
public UnsignedShort(String value)
throws IllegalArgumentException
Constructor for UnsignedShort.
value - a String object.
IllegalArgumentException - if any.public UnsignedShort(Number value)
Constructor for UnsignedShort.
value - a Number object.| Method Detail |
|---|
public static UnsignedShort max(UnsignedShort v0,
UnsignedShort v1)
max.
v0 - a UnsignedShort object.v1 - a UnsignedShort object.
UnsignedShort object.
public static UnsignedShort min(UnsignedShort v0,
UnsignedShort v1)
min.
v0 - a UnsignedShort object.v1 - a UnsignedShort object.
UnsignedShort object.public static UnsignedShort getFromBits(short value)
getFromBits.
value - a short.
UnsignedShort object.public static UnsignedShort valueOf(int value)
valueOf.
value - a int.
UnsignedShort object.public int getValue()
Getter for the field value.
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 short shortValue()
shortValue in class Numberpublic byte byteValue()
byteValue in class Numberpublic int compareTo(UnsignedShort o)
compareTo.
compareTo in interface Comparable<UnsignedShort>o - a UnsignedShort object.
public String toString()
toString in class Objectpublic int hashCode()
hashCode in class Objectpublic short toShortBits()
toShortBits.
public boolean equals(Object obj)
equals in class Objectpublic UnsignedShort inc()
public UnsignedShort dec()
IllegalArgumentException - if the value was 0 before the callpublic UnsignedShort add(int increment)
increment - the value to add to the current value
public UnsignedShort add(UnsignedShort increment)
increment - the value to add to the current value
public UnsignedShort subtract(int decrement)
decrement - the value to subtract from the current value
IllegalArgumentException - if the decrement is bigger than the current valuepublic UnsignedShort subtract(UnsignedShort decrement)
decrement - the value to subtract from the current value
IllegalArgumentException - if the decrement is bigger than the current value
public static UnsignedShort parseUnsignedShort(String s)
throws NumberFormatException,
IllegalArgumentException
s - the string to parse, assumed to contain a positive Integer value
NumberFormatException - if the string cannot be parsed into an integer value
IllegalArgumentException - if the parsed value does not fit in the range of UnsignedShort
public static UnsignedShort parseUnsignedShort(String s,
int radix)
throws NumberFormatException,
IllegalArgumentException
Integer.parseInt(String, int)
s - the string to parse, assumed to contain a positive Integer 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 UnsignedShort
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||