Class UInt16
java.lang.Object
java.lang.Number
org.freedesktop.dbus.UInt16
- All Implemented Interfaces:
Serializable, Comparable<UInt16>
Class to represent 16-bit unsigned integers.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyteThe value of this as a byte.intCompare two UInt16s.doubleThe value of this as a double.booleanTest two UInt16s for equality.floatThe value of this as a float.inthashCode()intintValue()The value of this as a int.longThe value of this as a long.shortThe value of this as a short.toString()The value of this as a string.
-
Field Details
-
MAX_VALUE
public static final int MAX_VALUEMaximum possible value.- See Also:
-
MIN_VALUE
public static final int MIN_VALUEMinimum possible value.- See Also:
-
-
Constructor Details
-
UInt16
public UInt16(int value) Create a UInt16 from an int.- Parameters:
value- Must be within MIN_VALUE–MAX_VALUE- Throws:
NumberFormatException- if value is not between MIN_VALUE and MAX_VALUE
-
UInt16
Create a UInt16 from a String.- Parameters:
value- Must parse to a valid integer within MIN_VALUE–MAX_VALUE- Throws:
NumberFormatException- if value is not an integer between MIN_VALUE and MAX_VALUE
-
-
Method Details
-
byteValue
-
doubleValue
public double doubleValue()The value of this as a double.- Specified by:
doubleValuein classNumber
-
floatValue
-
intValue
-
longValue
-
shortValue
-
equals
-
hashCode
-
compareTo
Compare two UInt16s.- Specified by:
compareToin interfaceComparable<UInt16>- Returns:
- 0 if equal, -ve or +ve if they are different.
-
toString
-