org.xlattice.util.cmdline
Class DoubleOpt
java.lang.Object
org.xlattice.util.cmdline.CmdLineOpt
org.xlattice.util.cmdline.DoubleOpt
public class DoubleOpt
- extends CmdLineOpt
Binds a command line argument to a double field in an object.
- Author:
- Jim Dixon
Constructor Summary |
DoubleOpt(java.lang.String oName,
java.lang.String fName)
|
DoubleOpt(java.lang.String oName,
java.lang.String fName,
double min,
double max)
|
DoubleOpt(java.lang.String oName,
java.lang.String fName,
java.lang.String desc)
|
DoubleOpt(java.lang.String oName,
java.lang.String fName,
java.lang.String desc,
double min,
double max)
Create the binding between the option and the field,
optionally specifying maximum and minimum values. |
Method Summary |
protected void |
bindField(java.lang.Class clazz)
Bind parameter to target class field. |
java.lang.String |
optionForHelp()
Overridden if something more elaborate than '-h' is needed. |
protected void |
setValue(Bindery bnd)
Set the value in the object field bound to this option. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DoubleOpt
public DoubleOpt(java.lang.String oName,
java.lang.String fName,
java.lang.String desc,
double min,
double max)
- Create the binding between the option and the field,
optionally specifying maximum and minimum values.
- Parameters:
oName
- option namefName
- field namedesc
- description in help messagemin
- minimum value permittedmax
- maximum value permitted
DoubleOpt
public DoubleOpt(java.lang.String oName,
java.lang.String fName,
double min,
double max)
DoubleOpt
public DoubleOpt(java.lang.String oName,
java.lang.String fName,
java.lang.String desc)
DoubleOpt
public DoubleOpt(java.lang.String oName,
java.lang.String fName)
optionForHelp
public java.lang.String optionForHelp()
- Description copied from class:
CmdLineOpt
- Overridden if something more elaborate than '-h' is needed.
- Overrides:
optionForHelp
in class CmdLineOpt
- Returns:
- the message displayed in a help message
bindField
protected void bindField(java.lang.Class clazz)
- Description copied from class:
CmdLineOpt
- Bind parameter to target class field. Must be invoked by subclasses.
- Overrides:
bindField
in class CmdLineOpt
- Parameters:
clazz
- target class for saving parameter values
setValue
protected void setValue(Bindery bnd)
- Description copied from class:
CmdLineOpt
- Set the value in the object field bound to this option.
Needs to be implemented for each primitive type accepted
on the command line.
- Specified by:
setValue
in class CmdLineOpt
- Parameters:
bnd
- command line option bindery invoking setValue