public class FloatStringParser extends StringParser
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.StringParser
,
Float
Constructor and Description |
---|
FloatStringParser()
Deprecated.
Use
getParser() or, even better, JSAP.FLOAT_PARSER . |
Modifier and Type | Method and Description |
---|---|
static FloatStringParser |
getParser()
Returns a
FloatStringParser . |
java.lang.Object |
parse(java.lang.String arg)
Parses the specified argument into a Float.
|
setUp, tearDown
public static FloatStringParser getParser()
FloatStringParser
.
Convenient access to the only instance returned by
this method is available through
JSAP.FLOAT_PARSER
.
FloatStringParser
.public java.lang.Object parse(java.lang.String arg) throws ParseException
parse
in class StringParser
arg
- the argument to parseParseException
- if new Float(arg)
throws a
NumberFormatException.Float
,
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