java.lang
Class Long

java.lang.Object
  extended by java.lang.Number
      extended by java.lang.Long
All Implemented Interfaces:
Comparable<Long>

public final class Long
extends Number
implements Comparable<Long>

Wrapper class for long integers.

Author:
Sven Köhler

Field Summary
static long MAX_VALUE
           
static long MIN_VALUE
           
static int SIZE
           
 
Constructor Summary
Long(long value)
           
Long(String s)
           
 
Method Summary
 int bitCount(long v)
           
 byte byteValue()
          Return the byte value of this Number.
 int compareTo(Long ob)
          Compares this with another Object.
 double doubleValue()
          Return the double value of this Number.
 boolean equals(Object o)
           
 float floatValue()
          Return the float value of this Number.
 int hashCode()
           
static long highestOneBit(long v)
           
 int intValue()
          Return the int value of this Number.
 long longValue()
          Return the long value of this Number.
static long lowestOneBit(long v)
           
static int numberOfLeadingZeros(long v)
           
static int numberOfTrailingZeros(long v)
           
static long parseLong(String s)
           
static long parseLong(String s, int radix)
           
static long reverse(long v)
           
static long reverseBytes(long v)
           
static long rotateLeft(long v, int bits)
           
static long rotateRight(long v, int bits)
           
 short shortValue()
          Return the short value of this Number.
static int signnum(long i)
           
static String toBinaryString(long v)
           
static String toHexString(long v)
           
static String toOctalString(long v)
           
 String toString()
           
static String toString(long v)
           
static String toString(long v, int radix)
           
static Long valueOf(long v)
           
static Long valueOf(String s)
           
static Long valueOf(String s, int radix)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MAX_VALUE

public static final long MAX_VALUE
See Also:
Constant Field Values

MIN_VALUE

public static final long MIN_VALUE
See Also:
Constant Field Values

SIZE

public static final int SIZE
See Also:
Constant Field Values
Constructor Detail

Long

public Long(long value)

Long

public Long(String s)
Method Detail

bitCount

public int bitCount(long v)

byteValue

public byte byteValue()
Description copied from class: Number
Return the byte value of this Number.

Overrides:
byteValue in class Number
Returns:
the byte value

compareTo

public int compareTo(Long ob)
Description copied from interface: Comparable
Compares this with another Object. Returns -1 if this object is smaller, 0 if both objects are equal and 1 if this object is bigger.

Specified by:
compareTo in interface Comparable<Long>
Parameters:
ob - the object to compare with
Returns:
one of the values -1, 0, 1

doubleValue

public double doubleValue()
Description copied from class: Number
Return the double value of this Number.

Specified by:
doubleValue in class Number
Returns:
the double value

equals

public boolean equals(Object o)
Overrides:
equals in class Object

floatValue

public float floatValue()
Description copied from class: Number
Return the float value of this Number.

Specified by:
floatValue in class Number
Returns:
the float value

hashCode

public int hashCode()
Overrides:
hashCode in class Object

highestOneBit

public static long highestOneBit(long v)

intValue

public int intValue()
Description copied from class: Number
Return the int value of this Number.

Specified by:
intValue in class Number
Returns:
the int value

longValue

public long longValue()
Description copied from class: Number
Return the long value of this Number.

Specified by:
longValue in class Number
Returns:
the long value

lowestOneBit

public static long lowestOneBit(long v)

numberOfLeadingZeros

public static int numberOfLeadingZeros(long v)

numberOfTrailingZeros

public static int numberOfTrailingZeros(long v)

parseLong

public static long parseLong(String s)

parseLong

public static long parseLong(String s,
                             int radix)

reverse

public static long reverse(long v)

reverseBytes

public static long reverseBytes(long v)

rotateLeft

public static long rotateLeft(long v,
                              int bits)

rotateRight

public static long rotateRight(long v,
                               int bits)

shortValue

public short shortValue()
Description copied from class: Number
Return the short value of this Number.

Overrides:
shortValue in class Number
Returns:
the short value

signnum

public static int signnum(long i)

toBinaryString

public static String toBinaryString(long v)

toOctalString

public static String toOctalString(long v)

toHexString

public static String toHexString(long v)

toString

public String toString()
Overrides:
toString in class Object

toString

public static String toString(long v)

toString

public static String toString(long v,
                              int radix)

valueOf

public static Long valueOf(long v)

valueOf

public static Long valueOf(String s)

valueOf

public static Long valueOf(String s,
                           int radix)