public class LongOption extends Option
long
valued arguments.Constructor and Description |
---|
LongOption(java.lang.String opt,
java.lang.String name,
java.lang.String usage,
int cmin,
int cmax,
long min,
long max) |
LongOption(java.lang.String opt,
java.lang.String name,
java.lang.String usage,
int cmin,
int cmax,
long min,
long max,
java.lang.Object[] defalt)
creates a command line option with default.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
addRestrictions(java.lang.String s)
override in subclass to describe restrictions applied to
values, like numerical range.
|
java.lang.Object |
check(java.lang.Object v)
checks if the given
Object is a valid value for this option
or can be converted to one. |
java.lang.String |
getTypeName() |
public LongOption(java.lang.String opt, java.lang.String name, java.lang.String usage, int cmin, int cmax, long min, long max, java.lang.Object[] defalt) throws CommandlineException
creates a command line option with default.
CommandlineException
- if the number of defaults is wrong or they are not of type
Long
or String
or they fall outside
the given ranges.public LongOption(java.lang.String opt, java.lang.String name, java.lang.String usage, int cmin, int cmax, long min, long max)
public java.lang.String getTypeName()
public java.lang.Object check(java.lang.Object v) throws CommandlineException
Option
checks if the given Object
is a valid value for this option
or can be converted to one. This method converts the value, if possible and
necessary and returns the resulting Object
.
Hint: Subclasses must override this method to make sure the right objects are stored.
CommandlineException
- if the value does not meet the requirements for this option (e.g.
wrong type, value too large) and cannot be (easily) converted.