@GwtCompatible(serializable=true) public final class UnsignedLong extends Number implements Comparable<UnsignedLong>, Serializable
long values, supporting arithmetic operations.
 In some cases, when speed is more important than code readability, it may be faster simply to
 treat primitive long values as unsigned, using the methods from UnsignedLongs.
 
See the Guava User Guide article on unsigned primitive utilities.
| Modifier and Type | Field and Description | 
|---|---|
| static UnsignedLong | MAX_VALUE | 
| static UnsignedLong | ONE | 
| static UnsignedLong | ZERO | 
| Modifier and Type | Method and Description | 
|---|---|
| BigInteger | bigIntegerValue()Returns the value of this  UnsignedLongas aBigInteger. | 
| int | compareTo(UnsignedLong o) | 
| UnsignedLong | dividedBy(UnsignedLong val)Returns the result of dividing this by  val. | 
| double | doubleValue()Returns the value of this  UnsignedLongas adouble, analogous to a widening
 primitive conversion fromlongtodouble, and correctly rounded. | 
| boolean | equals(Object obj) | 
| float | floatValue()Returns the value of this  UnsignedLongas afloat, analogous to a widening
 primitive conversion fromlongtofloat, and correctly rounded. | 
| static UnsignedLong | fromLongBits(long bits)Returns an  UnsignedLongcorresponding to a given bit representation. | 
| int | hashCode() | 
| int | intValue()Returns the value of this  UnsignedLongas anint. | 
| long | longValue()Returns the value of this  UnsignedLongas along. | 
| UnsignedLong | minus(UnsignedLong val)Returns the result of subtracting this and  val. | 
| UnsignedLong | mod(UnsignedLong val)Returns this modulo  val. | 
| UnsignedLong | plus(UnsignedLong val)Returns the result of adding this and  val. | 
| UnsignedLong | times(UnsignedLong val)Returns the result of multiplying this and  val. | 
| String | toString()Returns a string representation of the  UnsignedLongvalue, in base 10. | 
| String | toString(int radix)Returns a string representation of the  UnsignedLongvalue, in baseradix. | 
| static UnsignedLong | valueOf(BigInteger value)Returns a  UnsignedLongrepresenting the same value as the specifiedBigInteger. | 
| static UnsignedLong | valueOf(long value)Returns an  UnsignedLongrepresenting the same value as the specifiedlong. | 
| static UnsignedLong | valueOf(String string)Returns an  UnsignedLongholding the value of the specifiedString, parsed as
 an unsignedlongvalue. | 
| static UnsignedLong | valueOf(String string,
              int radix)Returns an  UnsignedLongholding the value of the specifiedString, parsed as
 an unsignedlongvalue in the specified radix. | 
byteValue, shortValuepublic static final UnsignedLong ZERO
public static final UnsignedLong ONE
public static final UnsignedLong MAX_VALUE
public static UnsignedLong fromLongBits(long bits)
UnsignedLong corresponding to a given bit representation.
 The argument is interpreted as an unsigned 64-bit value. Specifically, the sign bit
 of bits is interpreted as a normal bit, and all other bits are treated as usual.
 If the argument is nonnegative, the returned result will be equal to bits,
 otherwise, the result will be equal to 2^64 + bits.
 
To represent decimal constants less than 2^63, consider valueOf(long)
 instead.
public static UnsignedLong valueOf(long value)
UnsignedLong representing the same value as the specified long.IllegalArgumentException - if value is negativepublic static UnsignedLong valueOf(BigInteger value)
UnsignedLong representing the same value as the specified
 BigInteger. This is the inverse operation of bigIntegerValue().IllegalArgumentException - if value is negative or value >= 2^64public static UnsignedLong valueOf(String string)
UnsignedLong holding the value of the specified String, parsed as
 an unsigned long value.NumberFormatException - if the string does not contain a parsable unsigned long
     valuepublic static UnsignedLong valueOf(String string, int radix)
UnsignedLong holding the value of the specified String, parsed as
 an unsigned long value in the specified radix.NumberFormatException - if the string does not contain a parsable unsigned long
     value, or radix is not between Character.MIN_RADIX and
     Character.MAX_RADIX@CheckReturnValue public UnsignedLong plus(UnsignedLong val)
val. If the result would have more than 64 bits,
 returns the low 64 bits of the result.@CheckReturnValue public UnsignedLong minus(UnsignedLong val)
val. If the result would have more than 64
 bits, returns the low 64 bits of the result.@CheckReturnValue public UnsignedLong times(UnsignedLong val)
val. If the result would have more than 64
 bits, returns the low 64 bits of the result.@CheckReturnValue public UnsignedLong dividedBy(UnsignedLong val)
val.@CheckReturnValue public UnsignedLong mod(UnsignedLong val)
val.public int intValue()
UnsignedLong as an int.public long longValue()
UnsignedLong as a long. This is an inverse operation
 to fromLongBits(long).
 Note that if this UnsignedLong holds a value >= 2^63, the returned value
 will be equal to this - 2^64.
public float floatValue()
UnsignedLong as a float, analogous to a widening
 primitive conversion from long to float, and correctly rounded.floatValue in class Numberpublic double doubleValue()
UnsignedLong as a double, analogous to a widening
 primitive conversion from long to double, and correctly rounded.doubleValue in class Numberpublic BigInteger bigIntegerValue()
UnsignedLong as a BigInteger.public int compareTo(UnsignedLong o)
compareTo in interface Comparable<UnsignedLong>public String toString()
UnsignedLong value, in base 10.Copyright © 2010-2015. All Rights Reserved.