- java.lang.Object
-
- snaq.util.jclap.Option<Long>
-
- snaq.util.jclap.LongOption
-
-
Field Summary
-
Fields inherited from class snaq.util.jclap.Option
BUNDLE, LOCALE, MAX_COUNT_LIMIT, MIN_COUNT_LIMIT
-
-
Constructor Summary
Constructors Constructor Description LongOption(String shortName, String longName, String description, boolean mandatory, boolean allowMany)Creates a newLongOptioninstance.LongOption(String shortName, String longName, String description, int minCount, int maxCount)Creates a newLongOptioninstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Class<Long>getType()Returns the class type of value this option can take.protected LongparseValue(String arg, Locale locale)Parses the argument string for an option value, optionally using the specified locale for reference (e.g.-
Methods inherited from class snaq.util.jclap.Option
addValue, equals, getDescription, getLongName, getMaxCount, getMinCount, getShortName, getValues, hashCode, isAllowMany, isHidden, isMandatory, requiresValue, setHidden, setMinMaxCounts, toString
-
-
-
-
Constructor Detail
-
LongOption
public LongOption(String shortName, String longName, String description, int minCount, int maxCount)
Creates a newLongOptioninstance.- Parameters:
shortName- short name of the option (e.g. -?)longName- long name of the option (e.g. --help)description- helpful description of the option (printed for usage message)minCount- minimum number of occurrences required for this optionmaxCount- maximum number of occurrences required for this option
-
LongOption
public LongOption(String shortName, String longName, String description, boolean mandatory, boolean allowMany)
Creates a newLongOptioninstance.- Parameters:
shortName- short name of the option (e.g. -?)longName- long name of the option (e.g. --help)description- helpful description of the option (printed for usage message)mandatory- whether this option must be specifiedallowMany- whether this option can take more than one value (i.e. be specified more than once)
-
-
Method Detail
-
parseValue
protected Long parseValue(String arg, Locale locale) throws OptionException
Parses the argument string for an option value, optionally using the specified locale for reference (e.g. for date parsing).- Specified by:
parseValuein classOption<Long>- Parameters:
arg- string argument from which a value is to be parsedlocale- locale as specified when initializing theCLAParserinstance- Returns:
- Value of the parsed argument string
- Throws:
OptionException- if a problem occurs while parsing the argument string
-
-