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 |
|---|---|
| public static final UnsignedLong | |
| public static final UnsignedLong | |
| private static final long | |
| private final long | |
| public static final UnsignedLong |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public BigInteger | |
| public int | compareTo(UnsignedLong
the object to be compared. o)Implements java. |
| public UnsignedLong | |
| public double | doubleValue()
Implements abstract java. UnsignedLong as a double, analogous to a widening
primitive conversion from long to double, and correctly rounded.
|
| public boolean | equals(Object
the reference object with which to compare. obj)Overrides java. |
| public float | floatValue()
Implements abstract java. UnsignedLong as a float, analogous to a widening
primitive conversion from long to float, and correctly rounded.
|
| public static UnsignedLong | |
| public int | |
| public int | intValue()
Implements abstract java. UnsignedLong as an int.
|
| public long | longValue()
Implements abstract java. UnsignedLong as a long.
|
| public UnsignedLong | |
| public UnsignedLong | |
| public UnsignedLong | |
| public UnsignedLong | |
| public String | toString()
Overrides java. UnsignedLong value, in base 10.
|
| public String | |
| public static UnsignedLong | |
| public static UnsignedLong | valueOf(BigInteger value)
Returns a |
| public static UnsignedLong | |
| public static UnsignedLong |
| MAX_VALUE | back to summary |
|---|---|
| public static final UnsignedLong MAX_VALUE | |
| ONE | back to summary |
|---|---|
| public static final UnsignedLong ONE | |
| UNSIGNED_MASK | back to summary |
|---|---|
| private static final long UNSIGNED_MASK | |
| value | back to summary |
|---|---|
| private final long value | |
| ZERO | back to summary |
|---|---|
| public static final UnsignedLong ZERO | |
| UnsignedLong | back to summary |
|---|---|
| private UnsignedLong(long value) | |
| bigIntegerValue | back to summary |
|---|---|
| public BigInteger bigIntegerValue() Returns the value of this | |
| compareTo | back to summary |
|---|---|
| public int compareTo(UnsignedLong o) Implements java. Doc from java. Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. The implementor must ensure The implementor must also ensure that the relation is transitive:
Finally, the implementor must ensure that
| |
| dividedBy | back to summary |
|---|---|
| public UnsignedLong dividedBy(UnsignedLong val) Returns the result of dividing this by
| |
| doubleValue | back to summary |
|---|---|
| public double doubleValue() Implements abstract java. Returns the value of this
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| floatValue | back to summary |
|---|---|
| public float floatValue() Implements abstract java. Returns the value of this
| |
| fromLongBits | back to summary |
|---|---|
| public static UnsignedLong fromLongBits(long bits) Returns an If the argument is nonnegative, the returned result will be equal to To represent decimal constants less than
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| intValue | back to summary |
|---|---|
| public int intValue() Implements abstract java. Returns the value of this
| |
| longValue | back to summary |
|---|---|
| public long longValue() Implements abstract java. Returns the value of this Note that if this
| |
| minus | back to summary |
|---|---|
| public UnsignedLong minus(UnsignedLong val) Returns the result of subtracting this and
| |
| mod | back to summary |
|---|---|
| public UnsignedLong mod(UnsignedLong val) Returns this modulo
| |
| plus | back to summary |
|---|---|
| public UnsignedLong plus(UnsignedLong val) Returns the result of adding this and
| |
| times | back to summary |
|---|---|
| public UnsignedLong times(UnsignedLong val) Returns the result of multiplying this and
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns a string representation of the
| |
| toString | back to summary |
|---|---|
| public String toString(int radix) Returns a string representation of the | |
| valueOf | back to summary |
|---|---|
| public static UnsignedLong valueOf(long value) Returns an
| |
| valueOf | back to summary |
|---|---|
| public static UnsignedLong valueOf(BigInteger value) Returns a
| |
| valueOf | back to summary |
|---|---|
| public static UnsignedLong valueOf(String string) Returns an
| |
| valueOf | back to summary |
|---|---|
| public static UnsignedLong valueOf(String string, int radix) Returns an
| |