All Implemented Interfaces:
Serializable, Comparable<Long>, Constable, ConstantDesc

  • Field Summary

    Fields

    static final int

    The number of bytes used to represent a long value in two's complement binary form.

    static final long

    A constant holding the maximum value a long can have, 263-1.

    static final long

    A constant holding the minimum value a long can have, -263.

    static final int

    The number of bits used to represent a long value in two's complement binary form.

    The Class instance representing the primitive type long.

  • Constructor Summary

    Constructors

  • Method Summary

    static int

    bitCount(long i)

    Returns the number of one-bits in the two's complement binary representation of the specified long value.

    byte

    byteValue()

    Returns the value of this Long as a byte after a narrowing primitive conversion.

    static int

    compare(long x, long y)

    Compares two long values numerically.

    int

    compareTo(Long anotherLong)

    Compares two Long objects numerically.

    static int

    compareUnsigned(long x, long y)

    Compares two long values numerically treating the values as unsigned.

    static long

    compress(long i, long mask)

    Returns the value obtained by compressing the bits of the specified long value, i, in accordance with the specified bit mask.

    Decodes a String into a Long.

    Returns an Optional containing the nominal descriptor for this instance, which is the instance itself.

    static long

    divideUnsigned(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

    Returns the value of this Long as a double after a widening primitive conversion.

    boolean

    Compares this object to the specified object.

    static long

    expand(long i, long mask)

    Returns the value obtained by expanding the bits of the specified long value, i, in accordance with the specified bit mask.

    float

    Returns the value of this Long as a float after a widening primitive conversion.

    Determines the long value of the system property with the specified name.

    Determines the long value of the system property with the specified name.

    Returns the long value of the system property with the specified name.

    int

    hashCode()

    Returns a hash code for this Long.

    static int

    hashCode(long value)

    Returns a hash code for a long value; compatible with Long.hashCode().

    static long

    highestOneBit(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 specified long value.

    int

    intValue()

    Returns the value of this Long as an int after a narrowing primitive conversion.

    long

    longValue()

    Returns the value of this Long as a long value.

    static long

    lowestOneBit(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 specified long value.

    static long

    max(long a, long b)

    Returns the greater of two long values as if by calling Math.max.

    static long

    min(long a, long b)

    Returns the smaller of two long values as if by calling Math.min.

    static int

    numberOfLeadingZeros(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(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 long value.

    static long

    parseLong(CharSequence s, int beginIndex, int endIndex, int radix)

    Parses the CharSequence argument as a signed long in the specified radix, beginning at the specified beginIndex and extending to endIndex - 1.

    static long

    Parses the string argument as a signed decimal long.

    static long

    Parses the string argument as a signed long in the radix specified by the second argument.

    static long

    parseUnsignedLong(CharSequence s, int beginIndex, int endIndex, int radix)

    Parses the CharSequence argument as an unsigned long in the specified radix, beginning at the specified beginIndex and extending to endIndex - 1.

    static long

    Parses the string argument as an unsigned decimal long.

    static long

    Parses the string argument as an unsigned long in the radix specified by the second argument.

    static long

    remainderUnsigned(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 long

    reverse(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(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(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(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

    Returns the value of this Long as a short after a narrowing primitive conversion.

    static int

    signum(long i)

    Returns the signum function of the specified long value.

    static long

    sum(long a, long b)

    Adds two long values together as per the + operator.

    toBinaryString(long i)

    Returns a string representation of the long argument as an unsigned integer in base 2.

    toHexString(long i)

    Returns a string representation of the long argument as an unsigned integer in base 16.

    toOctalString(long i)

    Returns a string representation of the long argument as an unsigned integer in base 8.

    toString()

    Returns a String object representing this Long's value.

    toString(long i)

    Returns a String object representing the specified long.

    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 Long instance representing the specified long value.

    Returns a Long object holding the value of the specified String.

    Returns a Long object holding the value extracted from the specified String when 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