public final class EnumeratedIntegerOption extends EnumeratedOption<Integer>
Option with value restricted to a
specified enumeration of type Integer.allowedValuesbundle, ILLEGAL_SN_CHARS, locale, MAX_COUNT_LIMIT, MIN_COUNT_LIMIT, values| Constructor and Description |
|---|
EnumeratedIntegerOption(String shortName,
String longName,
String description,
boolean mandatory,
boolean allowMany,
Collection<Integer> allowedValues)
Creates a new
EnumeratedIntegerOption instance. |
EnumeratedIntegerOption(String shortName,
String longName,
String description,
int minCount,
int maxCount,
Collection<Integer> allowedValues)
Creates a new
EnumeratedIntegerOption instance. |
| Modifier and Type | Method and Description |
|---|---|
Class<Integer> |
getType()
Returns the class type of value this option can take.
|
protected Integer |
parseValue(String arg)
Parses the argument string for an option value.
|
getAllowedValues, getAllowedValuesString, getAllowedValuesString, getAllowedValuesString, isValueValid, toStringaddValue, equals, getDescription, getLongName, getMaxCount, getMinCount, getShortName, getUsageTypeString, getValues, hashCode, isAllowMany, isHidden, isMandatory, requiresValue, setHidden, setMinMaxCountspublic EnumeratedIntegerOption(String shortName, String longName, String description, int minCount, int maxCount, Collection<Integer> allowedValues)
EnumeratedIntegerOption instance.shortName - short name of the option (e.g. -t)longName - long name of the option (e.g. --type)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 optionallowedValues - collection of possible values this option can takepublic EnumeratedIntegerOption(String shortName, String longName, String description, boolean mandatory, boolean allowMany, Collection<Integer> allowedValues)
EnumeratedIntegerOption instance.shortName - short name of the option (e.g. -t)longName - long name of the option (e.g. --type)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)allowedValues - collection of possible values this option can takeprotected Integer parseValue(String arg) throws OptionException
parseValue in class Option<Integer>arg - string argument from which a value is to be parsedOptionException - if a problem occurs while parsing the argument stringCopyright © 2017. All rights reserved.