Class BigIntegerStringParser
- java.lang.Object
-
- com.martiansoftware.jsap.StringParser
-
- com.martiansoftware.jsap.stringparsers.BigIntegerStringParser
-
public class BigIntegerStringParser extends StringParser
AStringParser
for parsing BigIntegers. The parse() method delegates the actual parsing to BigInteger's constructor.- Author:
- Marty Lamb
- See Also:
StringParser
,BigInteger
-
-
Constructor Summary
Constructors Constructor Description BigIntegerStringParser()
Deprecated.UsegetParser()
or, even better,JSAP.BIGINTEGER_PARSER
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BigIntegerStringParser
getParser()
Returns aBigIntegerStringParser
.java.lang.Object
parse(java.lang.String arg)
Parses the specified argument into a BigInteger.-
Methods inherited from class com.martiansoftware.jsap.StringParser
setUp, tearDown
-
-
-
-
Constructor Detail
-
BigIntegerStringParser
public BigIntegerStringParser()
Deprecated.UsegetParser()
or, even better,JSAP.BIGINTEGER_PARSER
.Creates a new BigIntegerStringParser.
-
-
Method Detail
-
getParser
public static BigIntegerStringParser getParser()
Returns aBigIntegerStringParser
.Convenient access to the only instance returned by this method is available through
JSAP.BIGINTEGER_PARSER
.- Returns:
- a
BigIntegerStringParser
.
-
parse
public java.lang.Object parse(java.lang.String arg) throws ParseException
Parses the specified argument into a BigInteger. This method simply delegates the parsing tonew BigInteger(String)
. If BigInteger throws a NumberFormatException, it is encapsulated into a ParseException and re-thrown.- Specified by:
parse
in classStringParser
- Parameters:
arg
- the argument to parse- Returns:
- a BigInteger object with the value contained in the specified argument.
- Throws:
ParseException
- ifnew BigInteger(arg)
throws a NumberFormatException.- See Also:
BigInteger
,StringParser.parse(String)
-
-