Long (Java SE 25 & JDK 25)
- All Implemented Interfaces:
Serializable, Comparable<Long>, Constable, ConstantDesc
-
Field Summary
Fields
static final intThe number of bytes used to represent a
longvalue in two's complement binary form.static final longA constant holding the maximum value a
longcan have, 263-1.static final longA constant holding the minimum value a
longcan have, -263.static final intThe number of bits used to represent a
longvalue in two's complement binary form.The
Classinstance representing the primitive typelong. -
Constructor Summary
Constructors
-
Method Summary
static intbitCount(long i) Returns the number of one-bits in the two's complement binary representation of the specified
longvalue.byteReturns the value of this
Longas abyteafter a narrowing primitive conversion.static intcompare(long x, long y) Compares two
longvalues numerically.intCompares two
Longobjects numerically.static intcompareUnsigned(long x, long y) Compares two
longvalues numerically treating the values as unsigned.static longcompress(long i, long mask) Returns the value obtained by compressing the bits of the specified
longvalue,i, in accordance with the specified bit mask.Decodes a
Stringinto aLong.Returns an
Optionalcontaining the nominal descriptor for this instance, which is the instance itself.static longdivideUnsigned(long dividend, long 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
Longas adoubleafter a widening primitive conversion.booleanCompares this object to the specified object.
static longexpand(long i, long mask) Returns the value obtained by expanding the bits of the specified
longvalue,i, in accordance with the specified bit mask.floatReturns the value of this
Longas afloatafter a widening primitive conversion.Determines the
longvalue of the system property with the specified name.Determines the
longvalue of the system property with the specified name.Returns the
longvalue of the system property with the specified name.inthashCode()Returns a hash code for this
Long.static inthashCode(long value) Returns a hash code for a
longvalue; compatible withLong.hashCode().static longhighestOneBit(long i) Returns a
longvalue with at most a single one-bit, in the position of the highest-order ("leftmost") one-bit in the specifiedlongvalue.intintValue()Returns the value of this
Longas anintafter a narrowing primitive conversion.longReturns the value of this
Longas alongvalue.static longlowestOneBit(long i) Returns a
longvalue with at most a single one-bit, in the position of the lowest-order ("rightmost") one-bit in the specifiedlongvalue.static longmax(long a, long b) Returns the greater of two
longvalues as if by callingMath.max.static longmin(long a, long b) Returns the smaller of two
longvalues as if by callingMath.min.static intnumberOfLeadingZeros(long i) Returns the number of zero bits preceding the highest-order ("leftmost") one-bit in the two's complement binary representation of the specified
longvalue.static intnumberOfTrailingZeros(long i) Returns the number of zero bits following the lowest-order ("rightmost") one-bit in the two's complement binary representation of the specified
longvalue.static longparseLong(CharSequence s, int beginIndex, int endIndex, int radix) Parses the
CharSequenceargument as a signedlongin the specifiedradix, beginning at the specifiedbeginIndexand extending toendIndex - 1.static longParses the string argument as a signed decimal
long.static longParses the string argument as a signed
longin the radix specified by the second argument.static longparseUnsignedLong(CharSequence s, int beginIndex, int endIndex, int radix) Parses the
CharSequenceargument as an unsignedlongin the specifiedradix, beginning at the specifiedbeginIndexand extending toendIndex - 1.static longParses the string argument as an unsigned decimal
long.static longParses the string argument as an unsigned
longin the radix specified by the second argument.static longremainderUnsigned(long dividend, long 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 longreverse(long i) Returns the value obtained by reversing the order of the bits in the two's complement binary representation of the specified
longvalue.static longreverseBytes(long i) Returns the value obtained by reversing the order of the bytes in the two's complement representation of the specified
longvalue.static longrotateLeft(long i, int distance) Returns the value obtained by rotating the two's complement binary representation of the specified
longvalue left by the specified number of bits.static longrotateRight(long i, int distance) Returns the value obtained by rotating the two's complement binary representation of the specified
longvalue right by the specified number of bits.shortReturns the value of this
Longas ashortafter a narrowing primitive conversion.static intsignum(long i) Returns the signum function of the specified
longvalue.static longsum(long a, long b) Adds two
longvalues together as per the + operator.toBinaryString(long i) Returns a string representation of the
longargument as an unsigned integer in base 2.toHexString(long i) Returns a string representation of the
longargument as an unsigned integer in base 16.toOctalString(long i) Returns a string representation of the
longargument as an unsigned integer in base 8.toString()Returns a
Stringobject representing thisLong's value.toString(long i) Returns a
Stringobject representing the specifiedlong.toString(long i, int radix) Returns a string representation of the first argument in the radix specified by the second argument.
toUnsignedString(long i) Returns a string representation of the argument as an unsigned decimal value.
toUnsignedString(long 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(long l) Returns a
Longinstance representing the specifiedlongvalue.Returns a
Longobject holding the value of the specifiedString.Returns a
Longobject 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
-
Long
-
Long
-
-
Method Details
-
toString
-
toUnsignedString
-
toHexString
-
toOctalString
-
toBinaryString
-
toString
-
toUnsignedString
-
parseLong
-
parseLong
-
parseLong
-
parseUnsignedLong
-
parseUnsignedLong
-
parseUnsignedLong
-
valueOf
-
valueOf
-
valueOf
-
decode
-
byteValue
-
shortValue
-
intValue
-
longValue
-
floatValue
-
doubleValue
-
toString
-
hashCode
-
hashCode
-
equals
-
getLong
-
getLong
-
getLong
-
compareTo
-
compare
-
compareUnsigned
-
divideUnsigned
-
remainderUnsigned
-
highestOneBit
-
lowestOneBit
-
numberOfLeadingZeros
-
numberOfTrailingZeros
-
bitCount
-
rotateLeft
-
rotateRight
-
reverse
-
compress
-
expand
-
signum
-
reverseBytes
-
sum
-
max
-
min
-
describeConstable
-
resolveConstantDesc
-