Top Description Fields Constructors Methods
org.freedesktop.dbus.types

public Class UInt16

extends Number
implements Comparable<UInt16>
Class Inheritance
All Implemented Interfaces
java.lang.Comparable
Annotations
@SuppressWarnings:serial

Class to represent 16-bit unsigned integers.

Field Summary

Modifier and TypeField and Description
public static final int
MAX_VALUE

Maximum possible value.

public static final int
MIN_VALUE

Minimum possible value.

private final int

Constructor Summary

AccessConstructor and Description
public
UInt16(int
Must be within MIN_VALUE–MAX_VALUE
_value
)

Create a UInt16 from an int.

public
UInt16(String
Must parse to a valid integer within MIN_VALUE–MAX_VALUE
_value
)

Create a UInt16 from a String.

Method Summary

Modifier and TypeMethod and Description
public byte
byteValue()

Overrides java.lang.Number.byteValue.

The value of this as a byte.

public int

Returns:

0 if equal, -ve or +ve if they are different.
compareTo
(UInt16
the object to be compared.
_other
)

Implements java.lang.Comparable.compareTo.

Compare two UInt16s.

public double
doubleValue()

Implements abstract java.lang.Number.doubleValue.

The value of this as a double.

public boolean
equals(Object
the reference object with which to compare.
_o
)

Overrides java.lang.Object.equals.

Test two UInt16s for equality.

public float
floatValue()

Implements abstract java.lang.Number.floatValue.

The value of this as a float.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public int
intValue()

Implements abstract java.lang.Number.intValue.

The value of this as a int.

public long
longValue()

Implements abstract java.lang.Number.longValue.

The value of this as a long.

public short
shortValue()

Overrides java.lang.Number.shortValue.

The value of this as a short.

public String
toString()

Overrides java.lang.Object.toString.

The value of this as a string.

Field Detail

MAX_VALUEback to summary
public static final int MAX_VALUE

Maximum possible value.

MIN_VALUEback to summary
public static final int MIN_VALUE

Minimum possible value.

valueback to summary
private final int value

Constructor Detail

UInt16back to summary
public UInt16(int _value)

Create a UInt16 from an int.

Parameters
_value:int

Must be within MIN_VALUE–MAX_VALUE

Exceptions
NumberFormatException:
if value is not between MIN_VALUE and MAX_VALUE
UInt16back to summary
public UInt16(String _value)

Create a UInt16 from a String.

Parameters
_value:String

Must parse to a valid integer within MIN_VALUE–MAX_VALUE

Exceptions
NumberFormatException:
if value is not an integer between MIN_VALUE and MAX_VALUE

Method Detail

byteValueback to summary
public byte byteValue()

Overrides java.lang.Number.byteValue.

The value of this as a byte.

Returns:byte

Doc from java.lang.Number.byteValue.

the numeric value represented by this object after conversion to type byte.

Annotations
@Override
compareToback to summary
public int compareTo(UInt16 _other)

Implements java.lang.Comparable.compareTo.

Compare two UInt16s.

Parameters
_other:UInt16

Doc from java.lang.Comparable.compareTo.

the object to be compared.

Returns:int

0 if equal, -ve or +ve if they are different.

Annotations
@Override
doubleValueback to summary
public double doubleValue()

Implements abstract java.lang.Number.doubleValue.

The value of this as a double.

Returns:double

Doc from java.lang.Number.doubleValue.

the numeric value represented by this object after conversion to type double.

Annotations
@Override
equalsback to summary
public boolean equals(Object _o)

Overrides java.lang.Object.equals.

Test two UInt16s for equality.

Parameters
_o:Object

Doc from java.lang.Object.equals.

the reference object with which to compare.

Returns:boolean

Doc from java.lang.Object.equals.

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
floatValueback to summary
public float floatValue()

Implements abstract java.lang.Number.floatValue.

The value of this as a float.

Returns:float

Doc from java.lang.Number.floatValue.

the numeric value represented by this object after conversion to type float.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

Annotations
@Override
intValueback to summary
public int intValue()

Implements abstract java.lang.Number.intValue.

The value of this as a int.

Returns:int

Doc from java.lang.Number.intValue.

the numeric value represented by this object after conversion to type int.

Annotations
@Override
longValueback to summary
public long longValue()

Implements abstract java.lang.Number.longValue.

The value of this as a long.

Returns:long

Doc from java.lang.Number.longValue.

the numeric value represented by this object after conversion to type long.

Annotations
@Override
shortValueback to summary
public short shortValue()

Overrides java.lang.Number.shortValue.

The value of this as a short.

Returns:short

Doc from java.lang.Number.shortValue.

the numeric value represented by this object after conversion to type short.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

The value of this as a string.

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object

Annotations
@Override