java.lang.Object
java.lang.Number
org.freedesktop.dbus.types.UInt64
- All Implemented Interfaces:
Serializable,Comparable<UInt64>
Class to represent unsigned 64-bit numbers.
Warning: Any functions which take or return a long
are restricted to the range of a signed 64bit number.
Use the BigInteger methods if you wish access to the full
range.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BigIntegerMaximum allowed value (when accessed as a BigInteger)static final longMaximum allowed value (when accessed as a long)static final longMinimum allowed value -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongbottom()Least significant 4 bytes.byteThe value of this as a byte.intCompare two UInt32s.doubleThe value of this as a double.booleanTest two UInt64s 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.longtop()Most significant 4 bytes.toString()The value of this as a string.value()The value of this as a BigInteger.
-
Field Details
-
MAX_LONG_VALUE
public static final long MAX_LONG_VALUEMaximum allowed value (when accessed as a long)- See Also:
-
MAX_BIG_VALUE
Maximum allowed value (when accessed as a BigInteger) -
MIN_VALUE
public static final long MIN_VALUEMinimum allowed value- See Also:
-
-
Constructor Details
-
UInt64
public UInt64(long _value) Create a UInt64 from a long.- Parameters:
_value- Must be a valid integer within MIN_VALUE–MAX_VALUE- Throws:
NumberFormatException- if value is not between MIN_VALUE and MAX_VALUE
-
UInt64
public UInt64(long _top, long _bottom) Create a UInt64 from two longs.- Parameters:
_top- Most significant 4 bytes._bottom- Least significant 4 bytes.
-
UInt64
Create a UInt64 from a BigInteger- Parameters:
_value- Must be a valid BigInteger between MIN_VALUE–MAX_BIG_VALUE- Throws:
NumberFormatException- if value is not an integer between MIN_VALUE and MAX_BIG_VALUE
-
UInt64
Create a UInt64 from a String.- Parameters:
_value- Must parse to a valid integer within MIN_VALUE–MAX_BIG_VALUE- Throws:
NumberFormatException- if value is not an integer between MIN_VALUE and MAX_BIG_VALUE
-
-
Method Details
-
value
The value of this as a BigInteger.- Returns:
- value
-
byteValue
public byte byteValue()The value of this as a byte. -
doubleValue
public double doubleValue()The value of this as a double.- Specified by:
doubleValuein classNumber
-
floatValue
public float floatValue()The value of this as a float.- Specified by:
floatValuein classNumber
-
intValue
public int intValue()The value of this as a int. -
longValue
public long longValue()The value of this as a long. -
shortValue
public short shortValue()The value of this as a short.- Overrides:
shortValuein classNumber
-
equals
Test two UInt64s for equality. -
hashCode
public int hashCode() -
compareTo
Compare two UInt32s.- Specified by:
compareToin interfaceComparable<UInt64>- Parameters:
_other- other uint64- Returns:
- 0 if equal, -ve or +ve if they are different.
-
toString
The value of this as a string. -
top
public long top()Most significant 4 bytes.- Returns:
- top
-
bottom
public long bottom()Least significant 4 bytes.- Returns:
- bottom
-