Integer (Java SE 23 & JDK 23)
-
Field Summary
Fields
static final intThe number of bytes used to represent an
intvalue in two's complement binary form.static final intA constant holding the maximum value an
intcan have, 231-1.static final intA constant holding the minimum value an
intcan have, -231.static final intThe number of bits used to represent an
intvalue in two's complement binary form.The
Classinstance representing the primitive typeint. -
Constructor Summary
Constructors
Integer(int value) Deprecated, for removal: This API element is subject to removal in a future version.
Deprecated, for removal: This API element is subject to removal in a future version.
-
Method Summary
static intbitCount(int i) Returns the number of one-bits in the two's complement binary representation of the specified
intvalue.byteReturns the value of this
Integeras abyteafter a narrowing primitive conversion.static intcompare(int x, int y) Compares two
intvalues numerically.intCompares two
Integerobjects numerically.static intcompareUnsigned(int x, int y) Compares two
intvalues numerically treating the values as unsigned.static intcompress(int i, int mask) Returns the value obtained by compressing the bits of the specified
intvalue,i, in accordance with the specified bit mask.Decodes a
Stringinto anInteger.Returns an
Optionalcontaining the nominal descriptor for this instance, which is the instance itself.static intdivideUnsigned(int dividend, int divisor) Returns the unsigned quotient of dividing the first argument by the second where each argument and the result is interpreted as an unsigned value.
doubleReturns the value of this
Integeras adoubleafter a widening primitive conversion.booleanCompares this object to the specified object.
static intexpand(int i, int mask) Returns the value obtained by expanding the bits of the specified
intvalue,i, in accordance with the specified bit mask.floatReturns the value of this
Integeras afloatafter a widening primitive conversion.Determines the integer value of the system property with the specified name.
Determines the integer value of the system property with the specified name.
Returns the integer value of the system property with the specified name.
inthashCode()Returns a hash code for this
Integer.static inthashCode(int value) Returns a hash code for an
intvalue; compatible withInteger.hashCode().static inthighestOneBit(int i) Returns an
intvalue with at most a single one-bit, in the position of the highest-order ("leftmost") one-bit in the specifiedintvalue.intintValue()Returns the value of this
Integeras anint.longReturns the value of this
Integeras alongafter a widening primitive conversion.static intlowestOneBit(int i) Returns an
intvalue with at most a single one-bit, in the position of the lowest-order ("rightmost") one-bit in the specifiedintvalue.static intmax(int a, int b) Returns the greater of two
intvalues as if by callingMath.max.static intmin(int a, int b) Returns the smaller of two
intvalues as if by callingMath.min.static intnumberOfLeadingZeros(int i) Returns the number of zero bits preceding the highest-order ("leftmost") one-bit in the two's complement binary representation of the specified
intvalue.static intnumberOfTrailingZeros(int i) Returns the number of zero bits following the lowest-order ("rightmost") one-bit in the two's complement binary representation of the specified
intvalue.static intparseInt(CharSequence s, int beginIndex, int endIndex, int radix) Parses the
CharSequenceargument as a signedintin the specifiedradix, beginning at the specifiedbeginIndexand extending toendIndex - 1.static intParses the string argument as a signed decimal integer.
static intParses the string argument as a signed integer in the radix specified by the second argument.
static intparseUnsignedInt(CharSequence s, int beginIndex, int endIndex, int radix) Parses the
CharSequenceargument as an unsignedintin the specifiedradix, beginning at the specifiedbeginIndexand extending toendIndex - 1.static intParses the string argument as an unsigned decimal integer.
static intParses the string argument as an unsigned integer in the radix specified by the second argument.
static intremainderUnsigned(int dividend, int divisor) Returns the unsigned remainder from dividing the first argument by the second where each argument and the result is interpreted as an unsigned value.
Resolves this instance as a
ConstantDesc, the result of which is the instance itself.static intreverse(int i) Returns the value obtained by reversing the order of the bits in the two's complement binary representation of the specified
intvalue.static intreverseBytes(int i) Returns the value obtained by reversing the order of the bytes in the two's complement representation of the specified
intvalue.static introtateLeft(int i, int distance) Returns the value obtained by rotating the two's complement binary representation of the specified
intvalue left by the specified number of bits.static introtateRight(int i, int distance) Returns the value obtained by rotating the two's complement binary representation of the specified
intvalue right by the specified number of bits.shortReturns the value of this
Integeras ashortafter a narrowing primitive conversion.static intsignum(int i) Returns the signum function of the specified
intvalue.static intsum(int a, int b) Adds two integers together as per the + operator.
toBinaryString(int i) Returns a string representation of the integer argument as an unsigned integer in base 2.
toHexString(int i) Returns a string representation of the integer argument as an unsigned integer in base 16.
toOctalString(int i) Returns a string representation of the integer argument as an unsigned integer in base 8.
toString()Returns a
Stringobject representing thisInteger's value.toString(int i) Returns a
Stringobject representing the specified integer.toString(int i, int radix) Returns a string representation of the first argument in the radix specified by the second argument.
static longtoUnsignedLong(int x) Converts the argument to a
longby an unsigned conversion.toUnsignedString(int i) Returns a string representation of the argument as an unsigned decimal value.
toUnsignedString(int i, int radix) Returns a string representation of the first argument as an unsigned integer value in the radix specified by the second argument.
valueOf(int i) Returns an
Integerinstance representing the specifiedintvalue.Returns an
Integerobject holding the value of the specifiedString.Returns an
Integerobject holding the value extracted from the specifiedStringwhen parsed with the radix given by the second argument.
-
Field Details
-
MIN_VALUE
-
MAX_VALUE
-
TYPE
-
SIZE
-
BYTES
-
-
Constructor Details
-
Integer
-
Integer
-
-
Method Details
-
toString
-
toUnsignedString
-
toHexString
-
toOctalString
-
toBinaryString
-
toString
-
toUnsignedString
-
parseInt
-
parseInt
-
parseInt
-
parseUnsignedInt
-
parseUnsignedInt
-
parseUnsignedInt
-
valueOf
-
valueOf
-
valueOf
-
byteValue
-
shortValue
-
intValue
-
longValue
-
floatValue
-
doubleValue
-
toString
-
hashCode
-
hashCode
-
equals
-
getInteger
-
getInteger
-
getInteger
-
decode
-
compareTo
-
compare
-
compareUnsigned
-
toUnsignedLong
-
divideUnsigned
-
remainderUnsigned
-
highestOneBit
-
lowestOneBit
-
numberOfLeadingZeros
-
numberOfTrailingZeros
-
bitCount
-
rotateLeft
-
rotateRight
-
reverse
-
compress
-
expand
-
signum
-
reverseBytes
-
sum
-
max
-
min
-
describeConstable
-
resolveConstantDesc
-