Package org.apache.qpid.protonj2.types
Class UnsignedLong
java.lang.Object
java.lang.Number
org.apache.qpid.protonj2.types.UnsignedLong
- All Implemented Interfaces:
Serializable,Comparable<UnsignedLong>
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final UnsignedLongstatic final UnsignedLongstatic final UnsignedLong -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intcompare(long left, long right) Compares two long values numerically treating the values as unsigned.intcompareTo(long value) Compares the give long value to thisUnsignedLongnumerically treating the given value as unsigned.intdoublebooleanfloatinthashCode()intintValue()longtoString()static UnsignedLongvalueOf(long value) Returns an UnsignedLong instance representing the specified int value.static UnsignedLongReturns anUnsignedLonginstance representing the specifiedStringvalue.static UnsignedLongvalueOf(BigInteger value) Returns anUnsignedLonginstance representing the specifiedBigIntegervalue.Methods inherited from class java.lang.Number
byteValue, shortValue
-
Field Details
-
ZERO
-
ONE
-
MAX_VALUE
-
-
Constructor Details
-
UnsignedLong
public UnsignedLong(long underlying)
-
-
Method Details
-
intValue
public int intValue() -
longValue
public long longValue() -
bigIntegerValue
-
floatValue
public float floatValue()- Specified by:
floatValuein classNumber
-
doubleValue
public double doubleValue()- Specified by:
doubleValuein classNumber
-
equals
-
compareTo
public int compareTo(long value) Compares the give long value to thisUnsignedLongnumerically treating the given value as unsigned.- Parameters:
value- the long to compare to thisUnsignedLonginstance.- Returns:
- the value 0 if this == value; a value less than 0 if this < value as unsigned values; and a value greater than 0 if this > value as unsigned values
-
compareTo
- Specified by:
compareToin interfaceComparable<UnsignedLong>
-
compare
public static int compare(long left, long right) Compares two long values numerically treating the values as unsigned.- Parameters:
left- the left hand side long to compareright- the right hand side long to compare- Returns:
- the value 0 if left == right; a value less than 0 if left < right as unsigned values; and a value greater than 0 if left > right as unsigned values
-
hashCode
public int hashCode() -
toString
-
valueOf
Returns an UnsignedLong instance representing the specified int value. This method always returns a cachedUnsignedLonginstance for values in the range [0...255] which can save space and time over calling the constructorUnsignedLong(long)which will always create a new instance of theUnsignedLongtype.- Parameters:
value- The long value to return as anUnsignedLonginstance.- Returns:
- an
UnsignedLonginstance representing the unsigned view of the given long.
-
valueOf
Returns anUnsignedLonginstance representing the specifiedStringvalue. This method always returns a cachedUnsignedLonginstance for values in the range [0...255] which can save space and time over calling the constructorUnsignedLong(long)which will always create a new instance of theUnsignedLongtype.- Parameters:
value- The String value to return as anUnsignedLonginstance.- Returns:
- an
UnsignedLonginstance representing the unsigned view of the given String. - Throws:
NumberFormatException- if the given value is greater than the maxUnsignedLongvalue possible or theStringvalue given cannot be converted to a numeric value.
-
valueOf
Returns anUnsignedLonginstance representing the specifiedBigIntegervalue. This method always returns a cachedUnsignedLonginstance for values in the range [0...255] which can save space and time over calling the constructorUnsignedLong(long)which will always create a new instance of theUnsignedLongtype.- Parameters:
value- TheBigIntegervalue to return as anUnsignedLonginstance.- Returns:
- an
UnsignedLonginstance representing the unsigned view of the givenBigInteger. - Throws:
NumberFormatException- if the given value is greater than the maxUnsignedLongvalue possible.
-