Class FloatStringParser
java.lang.Object
com.martiansoftware.jsap.StringParser
com.martiansoftware.jsap.stringparsers.FloatStringParser
A
StringParser for parsing Floats. The parse() method delegates
the actual
parsing to new Float(String). If new Float(String)
throws a NumberFormatException, it
is encapsulated in a ParseException and re-thrown.- Author:
- Marty Lamb
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic FloatStringParserReturns aFloatStringParser.Parses the specified argument into a Float.Methods inherited from class StringParser
setUp, tearDown
-
Constructor Details
-
FloatStringParser
public FloatStringParser()Deprecated.UsegetParser()or, even better,JSAP.FLOAT_PARSER.Creates a new FloatStringParser.
-
-
Method Details
-
getParser
Returns aFloatStringParser.Convenient access to the only instance returned by this method is available through
JSAP.FLOAT_PARSER.- Returns:
- a
FloatStringParser.
-
parse
Parses the specified argument into a Float. This method delegates the actual parsing to new Float(String). If new Float(String) throws a NumberFormatException, it is encapsulated in a ParseException and re-thrown.- Specified by:
parsein classStringParser- Parameters:
arg- the argument to parse- Returns:
- a Float object with the value contained in the specified argument.
- Throws:
ParseException- ifnew Float(arg)throws a NumberFormatException.- See Also:
-
getParser()or, even better,JSAP.FLOAT_PARSER.