API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.lang. Long View Source
Author(s)
Lee Boynton
Arthur van Hoff
Josh Bloch
Since
JDK1.0
Version
1.81, 11/17/05
Serial
Hierarchy
 Object
      Number
          Long
Implements
 Comparable
Subclasses
Description
publicfinal class Long
  The Long class wraps a value of the primitive type long in an object.
See also:   
Constructors
public Long (long value)
  Constructs a newly allocated Long object that represents the specified long argument.
public Long (String s) throws NumberFormatException
  Constructs a newly allocated Long object that represents the long value indicated by the String parameter.
Methods
Hide/Show inherited methods
publicstatic int bitCount (long i)
  Returns the number of one-bits in the two's complement binary representation of the specified long value.
public byte byteValue () [Overrides Number]
Returns the value of this Long as a byte.
public int compareTo (Long anotherLong)
  Compares two Long objects numerically.
publicstatic Long decode (String nm) throws NumberFormatException
  Decodes a String into a Long.
public double doubleValue () [Specified in Number]
Returns the value of this Long as a double.
public boolean equals (Object obj)
  Compares this object to the specified object.
public float floatValue () [Specified in Number]
Returns the value of this Long as a float.
pack-privatestatic void getChars (long i, int index, char[] buf)
  Places characters representing the integer i into the character array buf.
publicstatic Long getLong (String nm)
  Determines the long value of the system property with the specified name.
publicstatic Long getLong (String nm, long val)
  Determines the long value of the system property with the specified name.
publicstatic Long getLong (String nm, Long val)
  Returns the long value of the system property with the specified name.
public int hashCode ()
  Returns a hash code for this Long.
publicstatic 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.
public int intValue () [Specified in Number]
Returns the value of this Long as an int.
public long longValue () [Specified in Number]
Returns the value of this Long as a long value.
publicstatic 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.
publicstatic 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.
publicstatic 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.
publicstatic long parseLong (String s) throws NumberFormatException
  Parses the string argument as a signed decimal long.
publicstatic long parseLong (String s, int radix) throws NumberFormatException
  Parses the string argument as a signed long in the radix specified by the second argument.
publicstatic 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.
publicstatic 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.
publicstatic 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.
publicstatic 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.
public short shortValue () [Overrides Number]
Returns the value of this Long as a short.
publicstatic int signum (long i)
  Returns the signum function of the specified long value.
pack-privatestatic int stringSize (long x)
publicstatic String toBinaryString (long i)
  Returns a string representation of the long argument as an unsigned integer in base 2.
publicstatic String toHexString (long i)
  Returns a string representation of the long argument as an unsigned integer in base 16.
publicstatic String toOctalString (long i)
  Returns a string representation of the long argument as an unsigned integer in base 8.
public String toString ()
  Returns a String object representing this Long's value.
publicstatic String toString (long i)
  Returns a String object representing the specified long.
publicstatic String toString (long i, int radix)
  Returns a string representation of the first argument in the radix specified by the second argument.
publicstatic Long valueOf (long l)
  Returns a Long instance representing the specified long value.
publicstatic Long valueOf (String s) throws NumberFormatException
  Returns a Long object holding the value of the specified String.
publicstatic Long valueOf (String s, int radix) throws NumberFormatException
  Returns a Long object holding the value extracted from the specified String when parsed with the radix given by the second argument.
Fields
Hide/Show inherited fields
publicfinalstatic long MAX_VALUE = "9223372036854775807"
A constant holding the maximum value a long can have, 263-1.
publicfinalstatic long MIN_VALUE = "-9223372036854775808"
A constant holding the minimum value a long can have, -263.
publicfinalstatic int SIZE = "64"
  The number of bits used to represent a long value in two's complement binary form.
publicfinalstatic Class<Long> TYPE
  The Class instance representing the primitive type long.
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar