com.martiansoftware.jsap.stringparsers
Class BigIntegerStringParser

java.lang.Object
  extended bycom.martiansoftware.jsap.StringParser
      extended bycom.martiansoftware.jsap.stringparsers.BigIntegerStringParser

public class BigIntegerStringParser
extends StringParser

A StringParser for parsing BigIntegers. The parse() method delegates the actual parsing to BigInteger's constructor.

Author:
Marty Lamb
See Also:
StringParser, BigInteger

Constructor Summary
BigIntegerStringParser()
          Deprecated. Use getParser() or, even better, JSAP.BIGINTEGER_PARSER.
 
Method Summary
static BigIntegerStringParser getParser()
          Returns a BigIntegerStringParser.
 Object parse(String arg)
          Parses the specified argument into a BigInteger.
 
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

BigIntegerStringParser

public BigIntegerStringParser()
Deprecated. Use getParser() or, even better, JSAP.BIGINTEGER_PARSER.

Creates a new BigIntegerStringParser.

Method Detail

getParser

public static BigIntegerStringParser getParser()
Returns a BigIntegerStringParser.

Convenient access to the only instance returned by this method is available through JSAP.BIGINTEGER_PARSER.

Returns:
a BigIntegerStringParser.

parse

public Object parse(String arg)
             throws ParseException
Parses the specified argument into a BigInteger. This method simply delegates the parsing to new BigInteger(String). If BigInteger throws a NumberFormatException, it is encapsulated into a ParseException and re-thrown.

Specified by:
parse in class StringParser
Parameters:
arg - the argument to parse
Returns:
a BigInteger object with the value contained in the specified argument.
Throws:
ParseException - if new BigInteger(arg) throws a NumberFormatException.
See Also:
BigInteger, StringParser.parse(String)


Copyright © 2002-2006, Martian Software, Inc.. All Rights Reserved.
For the latest version and documentation, please visit http://www.martiansoftware.com/jsap