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 . |
Object |
parse(String arg)
Parses the specified argument into a Float.
|
setUp, tearDown
public FloatStringParser()
getParser()
or, even better, JSAP.FLOAT_PARSER
.public static FloatStringParser getParser()
FloatStringParser
.
Convenient access to the only instance returned by
this method is available through
JSAP.FLOAT_PARSER
.
FloatStringParser
.public Object parse(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 © 2016. All rights reserved.