Long (Java Platform SE 8 ) (original) (raw)
Modifier and Type
Method
Description
static int
[bitCount](../../java/lang/Long.html#bitCount-long-)(long i)
Returns the number of one-bits in the two's complement binary representation of the specified long
value.
byte
[byteValue](../../java/lang/Long.html#byteValue--)()
Returns the value of this Long
as a byte
after a narrowing primitive conversion.
static int
[compare](../../java/lang/Long.html#compare-long-long-)(long x, long y)
Compares two long
values numerically.
int
[compareTo](../../java/lang/Long.html#compareTo-java.lang.Long-)([Long](../../java/lang/Long.html "class in java.lang") anotherLong)
Compares two Long
objects numerically.
static int
[compareUnsigned](../../java/lang/Long.html#compareUnsigned-long-long-)(long x, long y)
Compares two long
values numerically treating the values as unsigned.
static [Long](../../java/lang/Long.html "class in java.lang")
[decode](../../java/lang/Long.html#decode-java.lang.String-)([String](../../java/lang/String.html "class in java.lang") nm)
Decodes a String
into a Long
.
static long
[divideUnsigned](../../java/lang/Long.html#divideUnsigned-long-long-)(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.
double
[doubleValue](../../java/lang/Long.html#doubleValue--)()
Returns the value of this Long
as a double
after a widening primitive conversion.
boolean
[equals](../../java/lang/Long.html#equals-java.lang.Object-)([Object](../../java/lang/Object.html "class in java.lang") obj)
Compares this object to the specified object.
float
[floatValue](../../java/lang/Long.html#floatValue--)()
Returns the value of this Long
as a float
after a widening primitive conversion.
static [Long](../../java/lang/Long.html "class in java.lang")
[getLong](../../java/lang/Long.html#getLong-java.lang.String-)([String](../../java/lang/String.html "class in java.lang") nm)
Determines the long
value of the system property with the specified name.
static [Long](../../java/lang/Long.html "class in java.lang")
[getLong](../../java/lang/Long.html#getLong-java.lang.String-long-)([String](../../java/lang/String.html "class in java.lang") nm, long val)
Determines the long
value of the system property with the specified name.
static [Long](../../java/lang/Long.html "class in java.lang")
[getLong](../../java/lang/Long.html#getLong-java.lang.String-java.lang.Long-)([String](../../java/lang/String.html "class in java.lang") nm,[Long](../../java/lang/Long.html "class in java.lang") val)
Returns the long
value of the system property with the specified name.
int
[hashCode](../../java/lang/Long.html#hashCode--)()
Returns a hash code for this Long
.
static int
[hashCode](../../java/lang/Long.html#hashCode-long-)(long value)
Returns a hash code for a long
value; compatible withLong.hashCode()
.
static long
[highestOneBit](../../java/lang/Long.html#highestOneBit-long-)(long i)
Returns a long
value with at most a single one-bit, in the position of the highest-order ("leftmost") one-bit in the specifiedlong
value.
int
[intValue](../../java/lang/Long.html#intValue--)()
Returns the value of this Long
as an int
after a narrowing primitive conversion.
long
[longValue](../../java/lang/Long.html#longValue--)()
Returns the value of this Long
as along
value.
static long
[lowestOneBit](../../java/lang/Long.html#lowestOneBit-long-)(long i)
Returns a long
value with at most a single one-bit, in the position of the lowest-order ("rightmost") one-bit in the specifiedlong
value.
static long
[max](../../java/lang/Long.html#max-long-long-)(long a, long b)
Returns the greater of two long
values as if by calling Math.max.
static long
[min](../../java/lang/Long.html#min-long-long-)(long a, long b)
Returns the smaller of two long
values as if by calling Math.min.
static int
[numberOfLeadingZeros](../../java/lang/Long.html#numberOfLeadingZeros-long-)(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 long
value.
static int
[numberOfTrailingZeros](../../java/lang/Long.html#numberOfTrailingZeros-long-)(long i)
Returns the number of zero bits following the lowest-order ("rightmost") one-bit in the two's complement binary representation of the specifiedlong
value.
static long
[parseLong](../../java/lang/Long.html#parseLong-java.lang.String-)([String](../../java/lang/String.html "class in java.lang") s)
Parses the string argument as a signed decimal long
.
static long
[parseLong](../../java/lang/Long.html#parseLong-java.lang.String-int-)([String](../../java/lang/String.html "class in java.lang") s, int radix)
Parses the string argument as a signed long
in the radix specified by the second argument.
static long
[parseUnsignedLong](../../java/lang/Long.html#parseUnsignedLong-java.lang.String-)([String](../../java/lang/String.html "class in java.lang") s)
Parses the string argument as an unsigned decimal long
.
static long
[parseUnsignedLong](../../java/lang/Long.html#parseUnsignedLong-java.lang.String-int-)([String](../../java/lang/String.html "class in java.lang") s, int radix)
Parses the string argument as an unsigned long
in the radix specified by the second argument.
static long
[remainderUnsigned](../../java/lang/Long.html#remainderUnsigned-long-long-)(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.
static long
[reverse](../../java/lang/Long.html#reverse-long-)(long i)
Returns the value obtained by reversing the order of the bits in the two's complement binary representation of the specified long
value.
static long
[reverseBytes](../../java/lang/Long.html#reverseBytes-long-)(long i)
Returns the value obtained by reversing the order of the bytes in the two's complement representation of the specified long
value.
static long
[rotateLeft](../../java/lang/Long.html#rotateLeft-long-int-)(long i, int distance)
Returns the value obtained by rotating the two's complement binary representation of the specified long
value left by the specified number of bits.
static long
[rotateRight](../../java/lang/Long.html#rotateRight-long-int-)(long i, int distance)
Returns the value obtained by rotating the two's complement binary representation of the specified long
value right by the specified number of bits.
short
[shortValue](../../java/lang/Long.html#shortValue--)()
Returns the value of this Long
as a short
after a narrowing primitive conversion.
static int
[signum](../../java/lang/Long.html#signum-long-)(long i)
Returns the signum function of the specified long
value.
static long
[sum](../../java/lang/Long.html#sum-long-long-)(long a, long b)
Adds two long
values together as per the + operator.
static [String](../../java/lang/String.html "class in java.lang")
[toBinaryString](../../java/lang/Long.html#toBinaryString-long-)(long i)
Returns a string representation of the long
argument as an unsigned integer in base 2.
static [String](../../java/lang/String.html "class in java.lang")
[toHexString](../../java/lang/Long.html#toHexString-long-)(long i)
Returns a string representation of the long
argument as an unsigned integer in base 16.
static [String](../../java/lang/String.html "class in java.lang")
[toOctalString](../../java/lang/Long.html#toOctalString-long-)(long i)
Returns a string representation of the long
argument as an unsigned integer in base 8.
[String](../../java/lang/String.html "class in java.lang")
[toString](../../java/lang/Long.html#toString--)()
Returns a String
object representing thisLong
's value.
static [String](../../java/lang/String.html "class in java.lang")
[toString](../../java/lang/Long.html#toString-long-)(long i)
Returns a String
object representing the specifiedlong
.
static [String](../../java/lang/String.html "class in java.lang")
[toString](../../java/lang/Long.html#toString-long-int-)(long i, int radix)
Returns a string representation of the first argument in the radix specified by the second argument.
static [String](../../java/lang/String.html "class in java.lang")
[toUnsignedString](../../java/lang/Long.html#toUnsignedString-long-)(long i)
Returns a string representation of the argument as an unsigned decimal value.
static [String](../../java/lang/String.html "class in java.lang")
[toUnsignedString](../../java/lang/Long.html#toUnsignedString-long-int-)(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.
static [Long](../../java/lang/Long.html "class in java.lang")
[valueOf](../../java/lang/Long.html#valueOf-long-)(long l)
Returns a Long
instance representing the specifiedlong
value.
static [Long](../../java/lang/Long.html "class in java.lang")
[valueOf](../../java/lang/Long.html#valueOf-java.lang.String-)([String](../../java/lang/String.html "class in java.lang") s)
Returns a Long
object holding the value of the specified String
.
static [Long](../../java/lang/Long.html "class in java.lang")
[valueOf](../../java/lang/Long.html#valueOf-java.lang.String-int-)([String](../../java/lang/String.html "class in java.lang") s, int radix)
Returns a Long
object holding the value extracted from the specified String
when parsed with the radix given by the second argument.