org.opcfoundation.ua.builtintypes
Class UnsignedByte

java.lang.Object
  extended by java.lang.Number
      extended by org.opcfoundation.ua.builtintypes.UnsignedByte
All Implemented Interfaces:
Serializable, Comparable<UnsignedByte>

public final class UnsignedByte
extends Number
implements Comparable<UnsignedByte>

UnsignedByte class.

See Also:
Serialized Form

Field Summary
static NodeId ID
          Constant ID
static long L_MAX_VALUE
          Constant L_MAX_VALUE=0xFFL
static long L_MIN_VALUE
          Constant L_MIN_VALUE=0L
static UnsignedByte MAX_VALUE
          Constant MAX_VALUE
static UnsignedByte MIN_VALUE
          Constant MIN_VALUE
static UnsignedByte ONE
          Constant ONE
static UnsignedByte ZERO
          Constant ZERO
 
Constructor Summary
UnsignedByte()
          Constructor for UnsignedByte.
UnsignedByte(byte value)
          Constructor for UnsignedByte.
UnsignedByte(int value)
          Constructor for UnsignedByte.
UnsignedByte(long value)
          Constructor for UnsignedByte.
UnsignedByte(String valueString)
          Constructor for UnsignedByte.
 
Method Summary
 UnsignedByte add(int increment)
          Add a value.
 UnsignedByte add(UnsignedByte increment)
          Add a value.
static void assertValueInRange(int value)
          assertValueInRange.
static void assertValueInRange(long value)
          assertValueInRange.
 byte byteValue()
          
 int compareTo(UnsignedByte o)
          compareTo.
 UnsignedByte dec()
          Decrease the value by one.
 double doubleValue()
          
 boolean equals(Object obj)
          
 float floatValue()
          
static UnsignedByte getFromBits(byte value)
          getFromBits.
 int getValue()
          Getter for the field value.
 int hashCode()
          
 UnsignedByte inc()
          Increase the value by one.
 int intValue()
          
 long longValue()
          
static UnsignedByte max(UnsignedByte v0, UnsignedByte v1)
          max.
static UnsignedByte min(UnsignedByte v0, UnsignedByte v1)
          min.
static UnsignedByte parseUnsignedByte(String s)
          Parse an UnsignedByte value from a string
static UnsignedByte parseUnsignedByte(String s, int radix)
          Parses the string argument as an unsigned byte similar to Integer.parseInt(String, int)
 UnsignedByte subtract(int decrement)
          Subtract a value from this value.
 UnsignedByte subtract(UnsignedByte decrement)
          Subtract a value from this value.
 byte toByteBits()
          toByteBits.
 String toString()
          
static UnsignedByte valueOf(int 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

ID

public static final NodeId ID
Constant ID


L_MAX_VALUE

public static final long L_MAX_VALUE
Constant L_MAX_VALUE=0xFFL

See Also:
Constant Field Values

L_MIN_VALUE

public static final long L_MIN_VALUE
Constant L_MIN_VALUE=0L

See Also:
Constant Field Values

MAX_VALUE

public static final UnsignedByte MAX_VALUE
Constant MAX_VALUE


MIN_VALUE

public static final UnsignedByte MIN_VALUE
Constant MIN_VALUE


ZERO

public static final UnsignedByte ZERO
Constant ZERO


ONE

public static final UnsignedByte ONE
Constant ONE

Constructor Detail

UnsignedByte

public UnsignedByte()

Constructor for UnsignedByte.


UnsignedByte

public UnsignedByte(int value)
             throws IllegalArgumentException

Constructor for UnsignedByte.

Parameters:
value - a int.
Throws:
IllegalArgumentException - if any.

UnsignedByte

public UnsignedByte(long value)
             throws IllegalArgumentException

Constructor for UnsignedByte.

Parameters:
value - a long.
Throws:
IllegalArgumentException - if any.

UnsignedByte

public UnsignedByte(byte value)
             throws IllegalArgumentException

Constructor for UnsignedByte.

Parameters:
value - a byte.
Throws:
IllegalArgumentException - if any.

UnsignedByte

public UnsignedByte(String valueString)
             throws IllegalArgumentException

Constructor for UnsignedByte.

Parameters:
valueString - a String object.
Throws:
IllegalArgumentException - if any.
Method Detail

max

public static UnsignedByte max(UnsignedByte v0,
                               UnsignedByte v1)

max.

Parameters:
v0 - a UnsignedByte object.
v1 - a UnsignedByte object.
Returns:
a UnsignedByte object.

min

public static UnsignedByte min(UnsignedByte v0,
                               UnsignedByte v1)

min.

Parameters:
v0 - a UnsignedByte object.
v1 - a UnsignedByte object.
Returns:
a UnsignedByte object.

valueOf

public static UnsignedByte valueOf(int value)

valueOf.

Parameters:
value - a int.
Returns:
a UnsignedByte object.

getFromBits

public static UnsignedByte getFromBits(byte value)

getFromBits.

Parameters:
value - a byte.
Returns:
a UnsignedByte object.

assertValueInRange

public static void assertValueInRange(int value)

assertValueInRange.

Parameters:
value - a int.

assertValueInRange

public static void assertValueInRange(long value)

assertValueInRange.

Parameters:
value - a long.

getValue

public int getValue()

Getter for the field value.

Returns:
a int.

doubleValue

public double doubleValue()

Specified by:
doubleValue in class Number

floatValue

public float floatValue()

Specified by:
floatValue in class Number

intValue

public int intValue()

Specified by:
intValue in class Number

longValue

public long longValue()

Specified by:
longValue in class Number

byteValue

public byte byteValue()

Overrides:
byteValue in class Number

toByteBits

public byte toByteBits()

toByteBits.

Returns:
a byte.

compareTo

public int compareTo(UnsignedByte o)

compareTo.

Specified by:
compareTo in interface Comparable<UnsignedByte>
Parameters:
o - a UnsignedByte object.
Returns:
a int.

hashCode

public int hashCode()

Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)

Overrides:
equals in class Object

toString

public String toString()

Overrides:
toString in class Object

parseUnsignedByte

public static UnsignedByte parseUnsignedByte(String s)
Parse an UnsignedByte value from a string

Parameters:
s - the string to parse, assumed to contain a positive Integer value
Returns:
the respective UnsignedInteger

parseUnsignedByte

public static UnsignedByte parseUnsignedByte(String s,
                                             int radix)
Parses the string argument as an unsigned byte similar to Integer.parseInt(String, int)

Parameters:
s - the string to parse, assumed to contain a positive Integer value
radix - the radix to be used while parsing s.
Returns:
the respective UnsignedInteger

inc

public UnsignedByte inc()
Increase the value by one. Note that this object is not changed, but a new one is created.

Returns:
a new UnsignedByte, increased by 1 from this one.

dec

public UnsignedByte dec()
Decrease the value by one. Note that this object is not changed, but a new one is created.

Returns:
a new UnsignedByte, decreased by 1 from this one.
Throws:
IllegalArgumentException - if the value was 0 before the call

add

public UnsignedByte add(int increment)
Add a value. Note that this object is not changed, but a new one is created.

Parameters:
increment - the value to add to the current value
Returns:
a new UnsignedByte, increased by increment from this one.

add

public UnsignedByte add(UnsignedByte increment)
Add a value. Note that this object is not changed, but a new one is created.

Parameters:
increment - the value to add to the current value
Returns:
a new UnsignedByte, increased by increment from this one.

subtract

public UnsignedByte subtract(int decrement)
Subtract a value from this value. Note that this object is not changed, but a new one is created.

Parameters:
decrement - the value to subtract from the current value
Returns:
a new UnsignedByte, decreased by decrement from this one.
Throws:
IllegalArgumentException - if the decrement is bigger than the current value

subtract

public UnsignedByte subtract(UnsignedByte decrement)
Subtract a value from this value. Note that this object is not changed, but a new one is created.

Parameters:
decrement - the value to subtract from the current value
Returns:
a new UnsignedByte, decreased by decrement from this one.
Throws:
IllegalArgumentException - if the decrement is bigger than the current value


Copyright © 2018. All rights reserved.