|
Buglet - buglet.sourceforge.org | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--org.buglet.util.NumString
This is used for converting Strings containing numbers to various Java number formats.
| Constructor Summary | |
NumString()
|
|
| Method Summary | |
static double |
fractionToDouble(java.lang.String fraction)
Converts the String to a double. |
static void |
main(java.lang.String[] args)
main method, converts the given string to the various number formats, and prints out the results. |
static java.lang.String |
removeNonNumberChars(java.lang.String input)
|
static double |
todouble(java.lang.Object val)
|
static double |
todouble(java.lang.String val)
Converts the String to a double, returning -1 on exception in conversion. |
static double |
todouble(java.lang.String val,
double defaultVal)
Converts the String to a double, returning the defaultval on exception in conversion. |
static float |
tofloat(java.lang.String val)
Converts the String to a float, returning -1 on exception in conversion. |
static float |
tofloat(java.lang.String val,
float defaultVal)
Converts the String to a float, returning the defaulval on exception in conversion. |
static int |
toint(java.lang.String val)
Converts the String to an int, returning -1 on exception in conversion. |
static int |
toint(java.lang.String val,
int defaultVal)
Converts the String to an int, returning the defaultval on exception in conversion. |
static long |
tolong(java.lang.String val)
Converts the String to a long, returning -1 on exception in conversion. |
static long |
tolong(java.lang.String val,
long defaultVal)
Converts the String to a long, returning the defaulval on exception in conversion. |
| Methods inherited from class java.lang.Object |
|
| Constructor Detail |
public NumString()
| Method Detail |
public static int toint(java.lang.String val)
val -
public static int toint(java.lang.String val,
int defaultVal)
val - defaultVal - public static long tolong(java.lang.String val)
val -
public static long tolong(java.lang.String val,
long defaultVal)
val - defaultVal - public static float tofloat(java.lang.String val)
val -
public static float tofloat(java.lang.String val,
float defaultVal)
val - defaultVal - public static double todouble(java.lang.String val)
val - public static double todouble(java.lang.Object val)
public static double todouble(java.lang.String val,
double defaultVal)
val - defaultVal - public static double fractionToDouble(java.lang.String fraction)
fraction - public static java.lang.String removeNonNumberChars(java.lang.String input)
public static void main(java.lang.String[] args)
args -
|
Buglet - buglet.sourceforge.org | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||