|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsnaq.util.jclap.Option<E>
snaq.util.jclap.EnumeratedOption<E>
E
- the return type of the optionpublic abstract class EnumeratedOption<E>
Implementation of an Option
with value restricted to an
enumeration of a specified return value type.
Constructor Summary | |
---|---|
EnumeratedOption(java.lang.String shortName,
java.lang.String longName,
java.lang.String description,
boolean mandatory,
boolean allowMany,
java.util.Collection<E> allowedValues)
Creates a new EnumeratedOption instance. |
|
EnumeratedOption(java.lang.String shortName,
java.lang.String longName,
java.lang.String description,
int minCount,
int maxCount,
java.util.Collection<E> allowedValues)
Creates a new EnumeratedOption instance. |
Method Summary | |
---|---|
java.util.Collection<E> |
getAllowedValues()
Returns an unmodifiable collection of the values that can be assigned to this option. |
java.lang.String |
getAllowedValuesString()
|
java.lang.String |
getAllowedValuesString(java.lang.String fix,
java.lang.String separator)
Returns a string denoting the values that can be assigned to this option. |
java.lang.String |
getAllowedValuesString(java.lang.String prefix,
java.lang.String suffix,
java.lang.String separator)
Returns a string denoting the values that can be assigned to this option. |
boolean |
isValueValid(E value)
|
java.lang.String |
toString()
|
Methods inherited from class snaq.util.jclap.Option |
---|
equals, getDescription, getLongName, getMaxCount, getMinCount, getShortName, getType, getValues, hashCode, isAllowMany, isHidden, isMandatory, requiresValue, setHidden, setMinMaxCounts |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public EnumeratedOption(java.lang.String shortName, java.lang.String longName, java.lang.String description, int minCount, int maxCount, java.util.Collection<E> allowedValues)
EnumeratedOption
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 EnumeratedOption(java.lang.String shortName, java.lang.String longName, java.lang.String description, boolean mandatory, boolean allowMany, java.util.Collection<E> allowedValues)
EnumeratedOption
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 takeMethod Detail |
---|
public boolean isValueValid(E value)
value
- value to check for validity
public java.util.Collection<E> getAllowedValues()
public java.lang.String getAllowedValuesString(java.lang.String prefix, java.lang.String suffix, java.lang.String separator)
prefix
- prefix string for each allowed valuesuffix
- suffix string for each allowed valueseparator
- string to use for delimiting individual values
public java.lang.String getAllowedValuesString(java.lang.String fix, java.lang.String separator)
fix
- prefix/suffix string for each allowed value (e.g. ")separator
- string to use for delimiting individual values
public java.lang.String getAllowedValuesString()
public java.lang.String toString()
toString
in class Option<E>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |