| java.lang.Object java.lang.Number java.lang.Long
Inner Class :static class valueOfCache | |
Field Summary | |
final public static long | MAX_VALUE
Constant for the maximum long value, 263-1. | final public static long | MIN_VALUE
Constant for the minimum long value, -231. | final public static int | SIZE
Constant for the number of bits to represent a long in
two's compliment form. | final public static Class<Long> | TYPE The java.lang.Class that represents this class. |
Constructor Summary | |
public | Long(long value) Constructs a new instance of the receiver which represents the long
valued argument. | public | Long(String string) Constructs a new instance of this class given a string. |
Method Summary | |
public static int | bitCount(long lng)
Counts the number of 1 bits in the long value passed; this
is sometimes referred to as a population count.
Parameters: lng - The long value to process. | public byte | byteValue() | public int | compareTo(Long object)
Compares this Long to the Long passed. | public static Long | decode(String string) Parses the string argument as if it was a long value and returns the
result. | public double | doubleValue() | public boolean | equals(Object o) Compares the argument to the receiver, and answers true if they represent
the same object using a class specific comparison. | public float | floatValue() | public static Long | getLong(String string) Answers a Long representing the long value of the property named by the
argument. | public static Long | getLong(String string, long defaultValue) Answers a Long representing the long value of the property named by the
argument. | public static Long | getLong(String string, Long defaultValue) Answers an Long representing the long value of the property named by the
argument. | public int | hashCode() Answers an integer hash code for the receiver. | public static long | highestOneBit(long lng)
Determines the highest (leftmost) bit that is 1 and returns the value
that is the bit mask for that bit. | public int | intValue() | public long | longValue() | public static long | lowestOneBit(long lng)
Determines the lowest (rightmost) bit that is 1 and returns the value
that is the bit mask for that bit. | public static int | numberOfLeadingZeros(long lng)
Determines the number of leading zeros in the long passed
prior to the
Long.highestOneBit(long) highest one bit .
Parameters: lng - The long to process. | public static int | numberOfTrailingZeros(long lng)
Determines the number of trailing zeros in the long passed
after the
Long.lowestOneBit(long) lowest one bit .
Parameters: lng - The long to process. | public static long | parseLong(String string) Parses the string argument as if it was a long value and returns the
result. | public static long | parseLong(String string, int radix) Parses the string argument as if it was an long value and returns the
result. | public static long | reverse(long lng)
Reverses the bytes of a long .
Parameters: lng - The long to reverse. | public static long | reverseBytes(long lng)
Reverses the bytes of a long .
Parameters: lng - The long to reverse. | public static long | rotateLeft(long lng, int distance)
Rotates the bits of lng to the left by the
distance bits.
Parameters: lng - The long value to rotate left. Parameters: distance - The number of bits to rotate. | public static long | rotateRight(long lng, int distance)
Rotates the bits of lng to the right by the
distance bits.
Parameters: lng - The long value to rotate right. Parameters: distance - The number of bits to rotate. | public short | shortValue() | public static int | signum(long lng)
The signum function for long values. | public static String | toBinaryString(long l) Answers a string containing '0' and '1' characters which describe the
binary representation of the argument. | public static String | toHexString(long l) Answers a string containing characters in the range 0..7, a..f which
describe the hexadecimal representation of the argument. | public static String | toOctalString(long l) Answers a string containing characters in the range 0..7 which describe
the octal representation of the argument. | public String | toString() Answers a string containing a concise, human-readable description of the
receiver. | public static String | toString(long l) Answers a string containing characters in the range 0..9 which describe
the decimal representation of the argument. | public static String | toString(long l, int radix) Answers a string containing characters in the range 0..9, a..z (depending
on the radix) which describe the representation of the argument in that
radix.
Parameters: l - a long to get the representation of Parameters: radix - the base to use for conversion. | public static Long | valueOf(String string) Parses the string argument as if it was an long value and returns the
result. | public static Long | valueOf(String string, int radix) Parses the string argument as if it was an long value and returns the
result. | public static Long | valueOf(long lng)
Returns a Long instance for the long value
passed. |
MAX_VALUE | final public static long MAX_VALUE(Code) | |
Constant for the maximum long value, 263-1.
|
MIN_VALUE | final public static long MIN_VALUE(Code) | |
Constant for the minimum long value, -231.
|
SIZE | final public static int SIZE(Code) | |
Constant for the number of bits to represent a long in
two's compliment form.
since: 1.5 |
TYPE | final public static Class<Long> TYPE(Code) | | The java.lang.Class that represents this class.
|
Long | public Long(long value)(Code) | | Constructs a new instance of the receiver which represents the long
valued argument.
Parameters: value - the long to store in the new instance. |
Long | public Long(String string) throws NumberFormatException(Code) | | Constructs a new instance of this class given a string.
Parameters: string - a string representation of an long quantity. exception: NumberFormatException - if the argument could not be parsed as a long quantity. |
bitCount | public static int bitCount(long lng)(Code) | |
Counts the number of 1 bits in the long value passed; this
is sometimes referred to as a population count.
Parameters: lng - The long value to process. The number of 1 bits. since: 1.5 |
byteValue | public byte byteValue()(Code) | | Answers the byte value which the receiver represents
byte the value of the receiver. |
compareTo | public int compareTo(Long object)(Code) | |
Compares this Long to the Long passed. If
this instance's value is equal to the value of the instance passed, then
0 is returned. If this instance's value is less than the value of the
instance passed, then a negative value is returned. If this instance's
value is greater than the value of the instance passed, then a positive
value is returned.
Parameters: object - The instance to compare to. throws: NullPointerException - if object is null . since: 1.2 |
decode | public static Long decode(String string) throws NumberFormatException(Code) | | Parses the string argument as if it was a long value and returns the
result. Throws NumberFormatException if the string does not represent a
long quantity. The string may be a hexadecimal ("0x..."), octal ("0..."),
or decimal ("...") representation of a long.
Parameters: string - a string representation of an long quantity. Long the value represented by the argument exception: NumberFormatException - if the argument could not be parsed as an long quantity. |
doubleValue | public double doubleValue()(Code) | | Answers the double value which the receiver represents
double the value of the receiver. |
equals | public boolean equals(Object o)(Code) | | Compares the argument to the receiver, and answers true if they represent
the same object using a class specific comparison.
In this case, the argument must also be an Long, and the receiver and
argument must represent the same long value.
Parameters: o - the object to compare with this object true if the object is the same as this objectfalse if it is different from this object See Also: Long.hashCode |
floatValue | public float floatValue()(Code) | | Answers the float value which the receiver represents
float the value of the receiver. |
getLong | public static Long getLong(String string)(Code) | | Answers a Long representing the long value of the property named by the
argument. If the property could not be found, or its value could not be
parsed as a long, answer null.
Parameters: string - The name of the desired integer property. Long A Long representing the value of the property. |
getLong | public static Long getLong(String string, long defaultValue)(Code) | | Answers a Long representing the long value of the property named by the
argument. If the property could not be found, or its value could not be
parsed as a long, answer a Long representing the second argument.
Parameters: string - The name of the desired long property. Long An Long representing the value of the property. |
getLong | public static Long getLong(String string, Long defaultValue)(Code) | | Answers an Long representing the long value of the property named by the
argument. If the property could not be found, or its value could not be
parsed as an long, answer the second argument.
Parameters: string - The name of the desired long property. Long An Long representing the value of the property. |
hashCode | public int hashCode()(Code) | | Answers an integer hash code for the receiver. Any two objects which
answer true when passed to equals must
answer the same value for this method.
the receiver's hash See Also: Long.equals |
highestOneBit | public static long highestOneBit(long lng)(Code) | |
Determines the highest (leftmost) bit that is 1 and returns the value
that is the bit mask for that bit. This is sometimes referred to as the
Most Significant 1 Bit.
Parameters: lng - The long to interrogate. The bit mask indicating the highest 1 bit. since: 1.5 |
intValue | public int intValue()(Code) | | Answers the int value which the receiver represents
int the value of the receiver. |
longValue | public long longValue()(Code) | | Answers the long value which the receiver represents
long the value of the receiver. |
lowestOneBit | public static long lowestOneBit(long lng)(Code) | |
Determines the lowest (rightmost) bit that is 1 and returns the value
that is the bit mask for that bit. This is sometimes referred to as the
Least Significant 1 Bit.
Parameters: lng - The long to interrogate. The bit mask indicating the lowest 1 bit. since: 1.5 |
numberOfLeadingZeros | public static int numberOfLeadingZeros(long lng)(Code) | |
Determines the number of leading zeros in the long passed
prior to the
Long.highestOneBit(long) highest one bit .
Parameters: lng - The long to process. The number of leading zeros. since: 1.5 |
numberOfTrailingZeros | public static int numberOfTrailingZeros(long lng)(Code) | |
Determines the number of trailing zeros in the long passed
after the
Long.lowestOneBit(long) lowest one bit .
Parameters: lng - The long to process. The number of trailing zeros. since: 1.5 |
parseLong | public static long parseLong(String string) throws NumberFormatException(Code) | | Parses the string argument as if it was a long value and returns the
result. Throws NumberFormatException if the string does not represent a
long quantity.
Parameters: string - a string representation of a long quantity. long the value represented by the argument exception: NumberFormatException - if the argument could not be parsed as a long quantity. |
parseLong | public static long parseLong(String string, int radix) throws NumberFormatException(Code) | | Parses the string argument as if it was an long value and returns the
result. Throws NumberFormatException if the string does not represent an
long quantity. The second argument specifies the radix to use when
parsing the value.
Parameters: string - a string representation of an long quantity. Parameters: radix - the base to use for conversion. long the value represented by the argument exception: NumberFormatException - if the argument could not be parsed as an long quantity. |
reverse | public static long reverse(long lng)(Code) | |
Reverses the bytes of a long .
Parameters: lng - The long to reverse. The reversed value. since: 1.5 |
reverseBytes | public static long reverseBytes(long lng)(Code) | |
Reverses the bytes of a long .
Parameters: lng - The long to reverse. The reversed value. since: 1.5 |
rotateLeft | public static long rotateLeft(long lng, int distance)(Code) | |
Rotates the bits of lng to the left by the
distance bits.
Parameters: lng - The long value to rotate left. Parameters: distance - The number of bits to rotate. The rotated value. since: 1.5 |
rotateRight | public static long rotateRight(long lng, int distance)(Code) | |
Rotates the bits of lng to the right by the
distance bits.
Parameters: lng - The long value to rotate right. Parameters: distance - The number of bits to rotate. The rotated value. since: 1.5 |
shortValue | public short shortValue()(Code) | | Answers the short value which the receiver represents
short the value of the receiver. |
signum | public static int signum(long lng)(Code) | |
The signum function for long values. This
method returns -1 for negative values, 1 for positive values and 0 for
the value 0.
Parameters: lng - The long value. -1 if negative, 1 if positive otherwise 0. since: 1.5 |
toBinaryString | public static String toBinaryString(long l)(Code) | | Answers a string containing '0' and '1' characters which describe the
binary representation of the argument.
Parameters: l - a long to get the binary representation of String the binary representation of the argument |
toHexString | public static String toHexString(long l)(Code) | | Answers a string containing characters in the range 0..7, a..f which
describe the hexadecimal representation of the argument.
Parameters: l - a long to get the hex representation of String the hex representation of the argument |
toOctalString | public static String toOctalString(long l)(Code) | | Answers a string containing characters in the range 0..7 which describe
the octal representation of the argument.
Parameters: l - a long to get the octal representation of String the octal representation of the argument |
toString | public String toString()(Code) | | Answers a string containing a concise, human-readable description of the
receiver.
a printable representation for the receiver. |
toString | public static String toString(long l)(Code) | | Answers a string containing characters in the range 0..9 which describe
the decimal representation of the argument.
Parameters: l - a long to get the representation of String the representation of the argument |
toString | public static String toString(long l, int radix)(Code) | | Answers a string containing characters in the range 0..9, a..z (depending
on the radix) which describe the representation of the argument in that
radix.
Parameters: l - a long to get the representation of Parameters: radix - the base to use for conversion. String the representation of the argument |
valueOf | public static Long valueOf(String string) throws NumberFormatException(Code) | | Parses the string argument as if it was an long value and returns the
result. Throws NumberFormatException if the string does not represent an
long quantity.
Parameters: string - a string representation of an long quantity. Long the value represented by the argument exception: NumberFormatException - if the argument could not be parsed as an long quantity. |
valueOf | public static Long valueOf(String string, int radix) throws NumberFormatException(Code) | | Parses the string argument as if it was an long value and returns the
result. Throws NumberFormatException if the string does not represent an
long quantity. The second argument specifies the radix to use when
parsing the value.
Parameters: string - a string representation of an long quantity. Parameters: radix - the base to use for conversion. Long the value represented by the argument exception: NumberFormatException - if the argument could not be parsed as an long quantity. |
valueOf | public static Long valueOf(long lng)(Code) | |
Returns a Long instance for the long value
passed. This method is preferred over the constructor, as this method may
maintain a cache of instances.
Parameters: lng - The long value. A Long instance. since: 1.5 |
|
|