Class BigIntegerStringParser

java.lang.Object
com.martiansoftware.jsap.StringParser
com.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 Details

  • Method Details

    • 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 java.lang.Object parse​(java.lang.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)