home *** CD-ROM | disk | FTP | other *** search
- package jargs.gnu;
-
- import java.text.NumberFormat;
- import java.text.ParseException;
- import java.util.Locale;
-
- public class CmdLineParser$Option$DoubleOption extends CmdLineParser.Option {
- public CmdLineParser$Option$DoubleOption(char shortForm, String longForm) {
- super(shortForm, longForm, true);
- }
-
- public CmdLineParser$Option$DoubleOption(String longForm) {
- super(longForm, true);
- }
-
- protected Object parseValue(String arg, Locale locale) throws CmdLineParser.IllegalOptionValueException {
- try {
- NumberFormat format = NumberFormat.getNumberInstance(locale);
- Number num = format.parse(arg);
- return new Double(num.doubleValue());
- } catch (ParseException var5) {
- throw new CmdLineParser.IllegalOptionValueException(this, arg);
- }
- }
- }
-