Package org.rwtodd.args
Class IntListParam
- All Implemented Interfaces:
OneArgParam,Param
A parameter type that accepts lists of integers. The list can take comma-separated
integers, as well as dots-separated ranges, and combinations of these. They will
be combined into an `IntStream`. The ends of the ranges are inclusive. Example:
1,5..8,13 ==> 1,5,6,7,8,13
-
Field Summary
Fields inherited from class org.rwtodd.args.BasicOneArgParam
arg, helpText, paramNames -
Constructor Summary
ConstructorsConstructorDescriptionIntListParam(Collection<String> names, String help) IntListParam(Collection<String> names, IntStream dflt, String help) -
Method Summary
Modifier and TypeMethodDescriptionprotected IntStreamconvertArg(String param, String arg) A conversion method to get a T from a string.
-
Constructor Details
-
IntListParam
-
IntListParam
-
-
Method Details
-
convertArg
Description copied from class:BasicOneArgParamA conversion method to get a T from a string. All subclasses must define this for the type they handle.- Specified by:
convertArgin classBasicOneArgParam<IntStream>- Parameters:
param- the name of the parameter found on the command line. In some cases it might affect conversion, but it is also good for error messages.arg- the argument to convert to a type T.- Returns:
- the converted argument.
- Throws:
Exception- if there is a problem with the conversion.
-