Package com.google.common.primitives
Class UnsignedInteger
java.lang.Object
java.lang.Number
com.google.common.primitives.UnsignedInteger
- All Implemented Interfaces:
Serializable,Comparable<UnsignedInteger>
@GwtCompatible(emulated=true)
@Deprecated(since="2022-12-01")
public final class UnsignedInteger
extends Number
implements Comparable<UnsignedInteger>
Deprecated.
The Google Guava Core Libraries are deprecated and will not be part of the AEM SDK after April 2023
A wrapper class for unsigned
int values, supporting arithmetic operations.
In some cases, when speed is more important than code readability, it may be faster simply to
treat primitive int values as unsigned, using the methods from UnsignedInts.
See the Guava User Guide article on unsigned primitive utilities.
- Since:
- 11.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final UnsignedIntegerDeprecated.static final UnsignedIntegerDeprecated.static final UnsignedIntegerDeprecated. -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Returns the value of thisUnsignedIntegeras aBigInteger.intcompareTo(UnsignedInteger other) Deprecated.Compares this unsigned integer to another unsigned integer.dividedBy(UnsignedInteger val) Deprecated.Returns the result of dividing this byval.doubleDeprecated.Returns the value of thisUnsignedIntegeras afloat, analogous to a widening primitive conversion frominttodouble, and correctly rounded.booleanDeprecated.floatDeprecated.Returns the value of thisUnsignedIntegeras afloat, analogous to a widening primitive conversion frominttofloat, and correctly rounded.static UnsignedIntegerfromIntBits(int bits) Deprecated.Returns anUnsignedIntegercorresponding to a given bit representation.inthashCode()Deprecated.intintValue()Deprecated.Returns the value of thisUnsignedIntegeras anint.longDeprecated.Returns the value of thisUnsignedIntegeras along.minus(UnsignedInteger val) Deprecated.Returns the result of subtracting this andval.mod(UnsignedInteger val) Deprecated.Returns this modval.plus(UnsignedInteger val) Deprecated.Returns the result of adding this andval.times(UnsignedInteger val) Deprecated.Returns the result of multiplying this andval.toString()Deprecated.Returns a string representation of theUnsignedIntegervalue, in base 10.toString(int radix) Deprecated.Returns a string representation of theUnsignedIntegervalue, in baseradix.static UnsignedIntegervalueOf(long value) Deprecated.Returns anUnsignedIntegerthat is equal tovalue, if possible.static UnsignedIntegerDeprecated.Returns anUnsignedIntegerholding the value of the specifiedString, parsed as an unsignedintvalue.static UnsignedIntegerDeprecated.Returns anUnsignedIntegerholding the value of the specifiedString, parsed as an unsignedintvalue in the specified radix.static UnsignedIntegervalueOf(BigInteger value) Deprecated.Returns aUnsignedIntegerrepresenting the same value as the specifiedBigInteger.Methods inherited from class java.lang.Number
byteValue, shortValue
-
Field Details
-
ZERO
Deprecated. -
ONE
Deprecated. -
MAX_VALUE
Deprecated.
-
-
Method Details
-
fromIntBits
Deprecated.Returns anUnsignedIntegercorresponding to a given bit representation. The argument is interpreted as an unsigned 32-bit value. Specifically, the sign bit ofbitsis 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 to2^32 + bits.To represent unsigned decimal constants, consider
valueOf(long)instead.- Since:
- 14.0
-
valueOf
Deprecated.Returns anUnsignedIntegerthat is equal tovalue, if possible. The inverse operation oflongValue(). -
valueOf
Deprecated.Returns aUnsignedIntegerrepresenting the same value as the specifiedBigInteger. This is the inverse operation ofbigIntegerValue().- Throws:
IllegalArgumentException- ifvalueis negative orvalue >= 2^32
-
valueOf
Deprecated.Returns anUnsignedIntegerholding the value of the specifiedString, parsed as an unsignedintvalue.- Throws:
NumberFormatException- if the string does not contain a parsable unsignedintvalue
-
valueOf
Deprecated.Returns anUnsignedIntegerholding the value of the specifiedString, parsed as an unsignedintvalue in the specified radix.- Throws:
NumberFormatException- if the string does not contain a parsable unsignedintvalue
-
plus
Deprecated.Returns the result of adding this andval. If the result would have more than 32 bits, returns the low 32 bits of the result.- Since:
- 14.0
-
minus
Deprecated.Returns the result of subtracting this andval. If the result would be negative, returns the low 32 bits of the result.- Since:
- 14.0
-
times
@CheckReturnValue @GwtIncompatible("Does not truncate correctly") public UnsignedInteger times(UnsignedInteger val) Deprecated.Returns the result of multiplying this andval. If the result would have more than 32 bits, returns the low 32 bits of the result.- Since:
- 14.0
-
dividedBy
Deprecated.Returns the result of dividing this byval.- Throws:
ArithmeticException- ifvalis zero- Since:
- 14.0
-
mod
Deprecated.Returns this modval.- Throws:
ArithmeticException- ifvalis zero- Since:
- 14.0
-
intValue
public int intValue()Deprecated.Returns the value of thisUnsignedIntegeras anint. This is an inverse operation tofromIntBits(int).Note that if this
UnsignedIntegerholds a value>= 2^31, the returned value will be equal tothis - 2^32. -
longValue
public long longValue()Deprecated.Returns the value of thisUnsignedIntegeras along. -
floatValue
public float floatValue()Deprecated.Returns the value of thisUnsignedIntegeras afloat, analogous to a widening primitive conversion frominttofloat, and correctly rounded.- Specified by:
floatValuein classNumber
-
doubleValue
public double doubleValue()Deprecated.Returns the value of thisUnsignedIntegeras afloat, analogous to a widening primitive conversion frominttodouble, and correctly rounded.- Specified by:
doubleValuein classNumber
-
bigIntegerValue
Deprecated.Returns the value of thisUnsignedIntegeras aBigInteger. -
compareTo
Deprecated.Compares this unsigned integer to another unsigned integer. Returns0if they are equal, a negative number ifthis < other, and a positive number ifthis > other.- Specified by:
compareToin interfaceComparable<UnsignedInteger>
-
hashCode
public int hashCode()Deprecated. -
equals
Deprecated. -
toString
Deprecated.Returns a string representation of theUnsignedIntegervalue, in base 10. -
toString
Deprecated.Returns a string representation of theUnsignedIntegervalue, in baseradix. Ifradix < Character.MIN_RADIXorradix > Character.MAX_RADIX, the radix10is used.
-