|
||||||||||
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(java.lang.String s,
boolean d)
Turns a string into a boolean value and returns a default value if unsuccessful. |
static int |
parseIfInt(java.lang.String s,
int def)
|
static int |
parseInt(java.lang.String s,
int def)
Turns a string into an int and returns a default value if unsuccessful. |
static int |
parseInt(java.lang.String s,
int def,
int[] lastIdx,
boolean allowNegative)
Turns a string into an int and returns a default value if unsuccessful. |
static java.lang.Number |
parseIntRadix(java.lang.String s,
int radix)
Turns a string into an int using a given radix. |
static java.lang.Number |
parseNumber(java.lang.String s,
java.lang.Number def)
Turns a string into a Number and returns a default value if unsuccessful. |
static java.lang.Number |
parseStrict(java.lang.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(java.lang.String s, boolean d)
s
- the string to convertd
- the default value
public static int parseInt(java.lang.String s, int def)
s
- the string to convertdef
- the default value
public static java.lang.Number parseIntRadix(java.lang.String s, int radix)
s
- the string to convertradix
- radix to use
public static int parseInt(java.lang.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 java.lang.Number parseNumber(java.lang.String s, java.lang.Number def)
s
- the string to convertdef
- the default value
public static java.lang.Number parseStrict(java.lang.String s)
s
- the string to convert
public static int parseIfInt(java.lang.String s, int def)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |