Module net.sourceforge.argparse4j
Class RangeArgumentChoice<T extends Comparable<T>>
java.lang.Object
net.sourceforge.argparse4j.impl.choice.RangeArgumentChoice<T>
- Type Parameters:
T
- The type to compare.
- All Implemented Interfaces:
ArgumentChoice
Choices from given range.
The given value will be checked if it is in range [min, max], inclusive. The
min
and max
are specified in constructor arguments.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRangeArgumentChoice
(T min, T max) Creates object using range [min
,max
], inclusive. -
Method Summary
-
Field Details
-
min_
-
max_
-
-
Constructor Details
-
RangeArgumentChoice
Creates object using range [min
,max
], inclusive.- Parameters:
min
- The lower bound of the range, inclusive.max
- The upper bound of the range, inclusive.
-
-
Method Details
-
contains
Description copied from interface:ArgumentChoice
Returns
true
iffval
is valid choice according to this object's constraint.If the objects derived from
RuntimeException
are thrown because of invalid input from command line, subclass must catch these exceptions and returnfalse
.- Specified by:
contains
in interfaceArgumentChoice
- Parameters:
val
- The attribute value.- Returns:
true
orfalse
.
-
textualFormat
Description copied from interface:ArgumentChoice
Return textual representation of this choice.
This string will be used in help and error messages.
- Specified by:
textualFormat
in interfaceArgumentChoice
- Returns:
- The textual representation of this choice.
-
toString
-