|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.martiansoftware.jsap.StringParser com.martiansoftware.jsap.stringparsers.IntegerStringParser
A StringParser
for parsing Integers. The parse() method delegates the actual
parsing to Integer.decode(String).
StringParser
,
Integer
Constructor Summary | |
IntegerStringParser()
Deprecated. Use getParser() or, even better, JSAP.INTEGER_PARSER . |
Method Summary | |
static IntegerStringParser |
getParser()
Returns a IntegerStringParser . |
Object |
parse(String arg)
Parses the specified argument into an Integer. |
Methods inherited from class com.martiansoftware.jsap.StringParser |
setUp, tearDown |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public IntegerStringParser()
getParser()
or, even better, JSAP.INTEGER_PARSER
.
Method Detail |
public static IntegerStringParser getParser()
IntegerStringParser
.
Convenient access to the only instance returned by
this method is available through
JSAP.INTEGER_PARSER
.
IntegerStringParser
.public Object parse(String arg) throws ParseException
Integer.decode(arg)
. If
Integer.decode()
throws a
NumberFormatException, it is encapsulated into a ParseException and
re-thrown.
parse
in class StringParser
arg
- the argument to parse
ParseException
- if Integer.decode(arg)
throws a
NumberFormatException.Integer
,
StringParser.parse(String)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |