|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.mongodb.util.StringParseUtil
public final class StringParseUtil
| Constructor Summary | |
|---|---|
StringParseUtil()
|
|
| Method Summary | |
|---|---|
static boolean |
parseBoolean(String s,
boolean d)
Turns a string into a boolean value and returns a default value if unsuccessful. |
static int |
parseIfInt(String s,
int def)
|
static int |
parseInt(String s,
int def)
Turns a string into an int and returns a default value if unsuccessful. |
static int |
parseInt(String s,
int def,
int[] lastIdx,
boolean allowNegative)
Turns a string into an int and returns a default value if unsuccessful. |
static Number |
parseIntRadix(String s,
int radix)
Turns a string into an int using a given radix. |
static Number |
parseNumber(String s,
Number def)
Turns a string into a Number and returns a default value if unsuccessful. |
static Number |
parseStrict(String s)
Use Java's "strict parsing" methods Integer.parseInt and Double.parseDouble to parse s "strictly". |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StringParseUtil()
| Method Detail |
|---|
public static boolean parseBoolean(String s,
boolean d)
s - the string to convertd - the default value
public static int parseInt(String s,
int def)
s - the string to convertdef - the default value
public static Number parseIntRadix(String s,
int radix)
s - the string to convertradix - radix to use
public static int parseInt(String s,
int def,
int[] lastIdx,
boolean allowNegative)
s - the string to convertdef - the default valuelastIdx - sets lastIdx[0] to the index of the last digitallowNegative - if negative numbers are valid
public static Number parseNumber(String s,
Number def)
s - the string to convertdef - the default value
public static Number parseStrict(String s)
s - the string to convert
public static int parseIfInt(String s,
int def)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||