org.freehep.util.argv
Class NumberParameter

java.lang.Object
  extended by org.freehep.util.argv.NumberParameter
All Implemented Interfaces:
Parameter
Direct Known Subclasses:
DoubleParameter, IntParameter

public class NumberParameter
extends Object
implements Parameter

A Number Parameter for use with ArgumentParser.

Version:
$Id: NumberParameter.java 8584 2006-08-10 23:06:37Z duns $
Author:
Mark Donszelmann

Constructor Summary
NumberParameter(String name, String description)
          Initialize a new Number parameter.
 
Method Summary
 String getName()
          Must return name of the parameter.
 String getUsage()
          Usage method invoked by ArgumentParser.
 BigDecimal getValue()
          Return the value of this argument, which may be null.
 int parse(List values)
          Parsing method invoked by ArgumentParser.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NumberParameter

public NumberParameter(String name,
                       String description)
Initialize a new Number parameter.

Method Detail

getValue

public BigDecimal getValue()
Return the value of this argument, which may be null. Returns the default value if the value was not set when the command line was parsed.


parse

public int parse(List values)
          throws MissingArgumentException,
                 ArgumentFormatException
Parsing method invoked by ArgumentParser.

Specified by:
parse in interface Parameter
Throws:
MissingArgumentException
ArgumentFormatException

getName

public String getName()
Description copied from interface: Parameter
Must return name of the parameter.

Specified by:
getName in interface Parameter

getUsage

public String getUsage()
Usage method invoked by ArgumentParser.

Specified by:
getUsage in interface Parameter


Copyright © 2000-2007 FreeHEP. All Rights Reserved.