Package org.freedesktop.dbus
Class UInt16
- java.lang.Object
-
- java.lang.Number
-
- org.freedesktop.dbus.UInt16
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<UInt16>
public class UInt16 extends java.lang.Number implements java.lang.Comparable<UInt16>
Class to represent 16-bit unsigned integers.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description bytebyteValue()The value of this as a byte.intcompareTo(UInt16 other)Compare two UInt16s.doubledoubleValue()The value of this as a double.booleanequals(java.lang.Object o)Test two UInt16s for equality.floatfloatValue()The value of this as a float.inthashCode()intintValue()The value of this as a int.longlongValue()The value of this as a long.shortshortValue()The value of this as a short.java.lang.StringtoString()The value of this as a string.
-
-
-
Field Detail
-
MAX_VALUE
public static final int MAX_VALUE
Maximum possible value.- See Also:
- Constant Field Values
-
MIN_VALUE
public static final int MIN_VALUE
Minimum possible value.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
UInt16
public UInt16(int value)
Create a UInt16 from an int.- Parameters:
value- Must be within MIN_VALUE–MAX_VALUE- Throws:
java.lang.NumberFormatException- if value is not between MIN_VALUE and MAX_VALUE
-
UInt16
public UInt16(java.lang.String value)
Create a UInt16 from a String.- Parameters:
value- Must parse to a valid integer within MIN_VALUE–MAX_VALUE- Throws:
java.lang.NumberFormatException- if value is not an integer between MIN_VALUE and MAX_VALUE
-
-
Method Detail
-
byteValue
public byte byteValue()
The value of this as a byte.- Overrides:
byteValuein classjava.lang.Number
-
doubleValue
public double doubleValue()
The value of this as a double.- Specified by:
doubleValuein classjava.lang.Number
-
floatValue
public float floatValue()
The value of this as a float.- Specified by:
floatValuein classjava.lang.Number
-
intValue
public int intValue()
The value of this as a int.- Specified by:
intValuein classjava.lang.Number
-
longValue
public long longValue()
The value of this as a long.- Specified by:
longValuein classjava.lang.Number
-
shortValue
public short shortValue()
The value of this as a short.- Overrides:
shortValuein classjava.lang.Number
-
equals
public boolean equals(java.lang.Object o)
Test two UInt16s for equality.- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
compareTo
public int compareTo(UInt16 other)
Compare two UInt16s.- Specified by:
compareToin interfacejava.lang.Comparable<UInt16>- Returns:
- 0 if equal, -ve or +ve if they are different.
-
toString
public java.lang.String toString()
The value of this as a string.- Overrides:
toStringin classjava.lang.Object
-
-