com.martiansoftware.jsap.stringparsers
Class LongStringParser

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

public class LongStringParser
extends StringParser

A StringParser for parsing Longs. The parse() method delegates the actual parsing to Long.decode(String).

Author:
Marty Lamb
See Also:
StringParser, Long

Constructor Summary
LongStringParser()
          Creates a new LongStringParser.
 
Method Summary
 Object parse(String arg)
          Parses the specified argument into a Long.
 
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

LongStringParser

public LongStringParser()
Creates a new LongStringParser.

Method Detail

parse

public Object parse(String arg)
             throws ParseException
Parses the specified argument into a Long. This method delegates the parsing to Long.decode(arg). If Long.decode() 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 Long object with the value contained in the specified argument.
Throws:
ParseException - if Long.decode(arg) throws a NumberFormatException.
See Also:
Long, StringParser.parse(String)


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