|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.lang.Number
com.jcorporate.expresso.core.misc.ReusableLong
Class that is nearly identical to the java.lang.Long class, except that you can reset the long value, useful for object reuse.
| Field Summary | |
static long |
MAX_VALUE
The largest value of type long. |
static long |
MIN_VALUE
The smallest value of type long. |
| Constructor Summary | |
ReusableLong()
Creates a new ReusableLong object. |
|
ReusableLong(long value)
|
|
ReusableLong(Long l)
Constructs a newly allocated ReusableLong object from a java.lang.Long object. |
|
ReusableLong(String s)
Constructor taking a sting value |
|
| Method Summary | |
byte |
byteValue()
Returns the value of this Long as a byte. |
int |
compareTo(Object o)
Compares this Long to another Object. |
int |
compareTo(ReusableLong anotherLong)
Compares two Longs numerically. |
static ReusableLong |
decode(String nm)
Decodes a String into a Long. |
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 ReusableLong |
getLong(String nm)
Determines the long value of the system property with the
specified name. |
static ReusableLong |
getLong(String nm,
long val)
Determines the long value of the system property with the
specified name. |
static ReusableLong |
getLong(String nm,
Long val)
Returns the long value of the system property with the specified name. |
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 value. |
static long |
parseLong(String s)
Parses the string argument as a signed decimal long. |
static long |
parseLong(String s,
int radix)
Parses the string argument as a signed long in the radix
specified by the second argument. |
void |
setLong(long newValue)
Resets the current long value. |
short |
shortValue()
Returns the value of this Long as a short. |
static String |
toBinaryString(long i)
Creates a string representation of the long argument as an unsigned integer in base 2. |
static String |
toHexString(long i)
Creates a string representation of the long argument as an unsigned integer in base 16. |
static String |
toOctalString(long i)
Creates a string representation of the long argument as an unsigned integer in base 8. |
static ReusableLong |
toReusableLong(Long l)
Converts a Long value to a reusable long value. |
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)
Creates a string representation of the first argument in the radix specified by the second argument. |
static ReusableLong |
valueOf(String s)
Returns a new long object initialized to the value of the specified String. |
static ReusableLong |
valueOf(String s,
int radix)
Returns a new long object initialized to the value of the specified String. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final long MIN_VALUE
long.
public static final long MAX_VALUE
long.
| Constructor Detail |
public ReusableLong()
public ReusableLong(long value)
value - the value to be represented by the Long
object.Constructs a newly allocated Long
object that represents the primitive long argument.public ReusableLong(Long l)
l - A java.lang.Long object
public ReusableLong(String s)
throws NumberFormatException
s - the string to be converted to a Long.
NumberFormatException - if the String does not
contain a parsable long integer.Long.Long(java.lang.String),
Long.valueOf(java.lang.String)| Method Detail |
public static ReusableLong decode(String nm)
throws NumberFormatException
String into a Long.
nm - Decodes a string to a usable state.
NumberFormatException - if the String does not
contain a parsable long.Long.decode(String),
Long.parseLong(String, int)
public static long parseLong(String s,
int radix)
throws NumberFormatException
long in the radix
specified by the second argument.
s - the String containing the long.radix - the radix to be used.
long represented by the string argument in the
specified radix.
NumberFormatException - if the string does not contain a
parsable integer.Long.parseLong(java.lang.String)
public static long parseLong(String s)
throws NumberFormatException
long.
s - a string.
long represented by the argument in decimal.
NumberFormatException - if the string does not contain a
parsable long.Long.parseLong(java.lang.String)public static String toBinaryString(long i)
i - a long.
Long.toBinaryString(long)public static String toHexString(long i)
i - a long.
Long.toHexString(long)public static String toOctalString(long i)
i - a long.
Long.toOctalString(long)public static ReusableLong toReusableLong(Long l)
l - a java.lang.Long object
public static String toString(long i,
int radix)
i - a long.radix - the radix.
Long.toString(),
Character.MAX_RADIX,
Character.MIN_RADIXpublic static String toString(long i)
i - a long to be converted.
Long.toString()
public static ReusableLong valueOf(String s,
int radix)
throws NumberFormatException
s - the String containing the long.radix - the radix to be used.
Long initialized to the value
represented by the string argument in the specified radix.
NumberFormatException - If the String does not
contain a parsable long.Long.valueOf(String,int)
public static ReusableLong valueOf(String s)
throws NumberFormatException
s - the string to be parsed.
Long initialized to the value
represented by the string argument.
NumberFormatException - If the String does not
contain a parsable long.Long.valueOf(String)public void setLong(long newValue)
newValue - a new value for the long objectpublic static ReusableLong getLong(String nm)
long value of the system property with the
specified name.
nm - property name.
Long value of the property.Long.getLong(java.lang.String),
System.getProperty(java.lang.String),
System.getProperty(java.lang.String, java.lang.String)
public static ReusableLong getLong(String nm,
long val)
long value of the system property with the
specified name.
nm - property name.val - default value.
Long value of the property.Long.getLong(java.lang.String),
System.getProperty(java.lang.String),
System.getProperty(java.lang.String, java.lang.String)
public static ReusableLong getLong(String nm,
Long val)
nm - the system property nameval - The java.lang.Long to translate
java.lang.Long#getLong(),
System.getProperty(String),
System.getProperty(String,String),
Long.decode(String)public byte byteValue()
Long.byteValue()public int compareTo(ReusableLong anotherLong)
anotherLong - another Long obejct to compare
Long.compareTo(Long)public int compareTo(Object o)
compareTo in interface Comparableo - The object to compare to.
Long.compareTo(Object)public double doubleValue()
long value represented by this object that is
converted to type double and the result of the
conversion is returned.Long.doubleValue()public boolean equals(Object obj)
true if and only if the argument is not null
and is a Long object that contains the same
long value as this object.
obj - the object to compare with.
true if the objects are the same;
false otherwise.Long.equals(java.lang.Object)public float floatValue()
long value represented by this object is
converted to type float and the result of the
conversion is returned.Long.floatValue()public int hashCode()
long value represented by this
Long object. That is, the hashcode is the value of the
expression:
(int)(this.longValue()^(this.longValue()>>>32))
java.lang.Long#hashcodepublic int intValue()
long value represented by this object is
converted to type int and the result of the
conversion is returned.Long.intValue()public long longValue()
long value represented by this object.Long.longValue()public short shortValue()
Long.shortValue()public String toString()
Long.toString()
|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||