public class LongStringParser extends StringParser
StringParser
for parsing Longs. The parse() method delegates the actual
parsing to Long.decode(String)
.StringParser
,
Long
Constructor and Description |
---|
LongStringParser()
Deprecated.
Use
getParser() or, even better, JSAP.LONG_PARSER . |
Modifier and Type | Method and Description |
---|---|
static LongStringParser |
getParser()
Returns a
LongStringParser . |
Object |
parse(String arg)
Parses the specified argument into a Long.
|
setUp, tearDown
public LongStringParser()
getParser()
or, even better, JSAP.LONG_PARSER
.public static LongStringParser getParser()
LongStringParser
.
Convenient access to the only instance returned by
this method is available through
JSAP.LONG_PARSER
.
LongStringParser
.public Object parse(String arg) throws ParseException
Long.decode(arg)
. If
Long.decode()
throws a
NumberFormatException, it is encapsulated into a ParseException and
re-thrown.parse
in class StringParser
arg
- the argument to parseParseException
- if Long.decode(arg)
throws a
NumberFormatException.Long
,
StringParser.parse(String)
Copyright © 2016. All rights reserved.