|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Number | +--java.lang.Long
The Long class provides an object wrapper for Long data values and serves as a place for long-oriented operations. A wrapper is useful because most of Java's utility classes require the use of objects. Since longs are not objects in Java, they need to be "wrapped" in a Long instance.
Field Summary | |
static long |
MAX_VALUE
The maximum value a Long can have. |
static long |
MIN_VALUE
The minimum value a Long can have. |
Constructor Summary | |
Long(long value)
Constructs a Long object initialized to the specified value. |
|
Long(String s)
Constructs a Long object initialized to the value specified by the String parameter. |
Method Summary | |
double |
doubleValue()
Returns the value of this Long as a double. |
boolean |
equals(Object obj)
Compares this object against the specified object. |
float |
floatValue()
Returns the value of this Long as a float. |
static Long |
getLong(String nm)
Gets a Long property. |
static Long |
getLong(String nm,
long val)
Gets a Long property. |
static Long |
getLong(String nm,
Long val)
Gets a Long property. |
int |
hashCode()
Computes a hashcode for this Long. |
int |
intValue()
Returns the value of this Long as an int. |
long |
longValue()
Returns the value of this Long as a long. |
static long |
parseLong(String s)
Assuming the specified String represents a long, return that long's value. |
static long |
parseLong(String s,
int radix)
Assuming the specified String represents a long, returns that long's value. |
static String |
toBinaryString(long i)
Returns a new String object representing the specified long as unsigned octal number. |
static String |
toHexString(long i)
Returns a new String object representing the specified long as unsigned hexidecimal number. |
static String |
toOctalString(long i)
Returns a new String object representing the specified long as unsigned octal number. |
String |
toString()
Returns a String object representing this Long's value. |
static String |
toString(long i)
Returns a new String object representing the specified integer. |
static String |
toString(long i,
int radix)
Returns a new String object representing the specified long in the specified radix. |
static Long |
valueOf(String s)
Assuming the specified String represents a long, returns a new Long object initialized to that value. |
static Long |
valueOf(String s,
int radix)
Assuming the specified String represents a long, returns a new Long object initialized to that value. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final long MIN_VALUE
public static final long MAX_VALUE
Constructor Detail |
public Long(long value)
value
- the initial value of the Longpublic Long(String s) throws NumberFormatException
s
- the String to be converted to a Long
NumberFormatException
- If the String does not contain a parsable
long.Method Detail |
public static String toString(long i, int radix)
i
- the long to be convertedradix
- the radixCharacter.MIN_RADIX
,
Character.MAX_RADIX
public static String toHexString(long i)
public static String toOctalString(long i)
public static String toBinaryString(long i)
public static String toString(long i)
i
- the long to be convertedpublic static long parseLong(String s, int radix) throws NumberFormatException
s
- the String containing the integerradix
- the radix to be used
NumberFormatException
- If the String does not
contain a parsable integer.public static long parseLong(String s) throws NumberFormatException
s
- the String containing the long
NumberFormatException
- If the string does not contain
a parsable long.public static Long valueOf(String s, int radix) throws NumberFormatException
s
- the String containing the long.radix
- the radix to be used
NumberFormatException
- If the String does not contain a parsable
long.public static Long valueOf(String s) throws NumberFormatException
s
- the String containing the long
NumberFormatException
- If the String does not contain a parsable
long.public int intValue()
intValue
in class Number
public long longValue()
longValue
in class Number
public float floatValue()
floatValue
in class Number
public double doubleValue()
doubleValue
in class Number
public String toString()
toString
in class Object
public int hashCode()
hashCode
in class Object
Hashtable
public boolean equals(Object obj)
equals
in class Object
obj
- the object to compare with
Hashtable
public static Long getLong(String nm)
nm
- the property namepublic static Long getLong(String nm, long val)
nm
- the String nameval
- the Long valuepublic static Long getLong(String nm, Long val)
nm
- the property nameval
- the Long value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |