|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectml.options.OptionSet
public class OptionSet
This class holds the information for a set of options. A set can hold any number of
OptionData
instances which are checked together to determine success or failure.
The approach to use this class looks like this:
Options.addSet()
(e. g. Options.addSet(String)
) to create
any number of sets required (or just relies on the default set, if only one set is required)
Options.check()
methods, each set can be checked whether the options
that were specified on the command line satisfy its requirements
Method Summary | |
---|---|
OptionSet |
addOption(String key)
Add a non-value option with the given key, and the default prefix and multiplicity |
OptionSet |
addOption(String key,
boolean details,
Options.Separator separator)
Add a value option with the given key and separator, possibly details, and the default prefix and multiplicity |
OptionSet |
addOption(String key,
boolean details,
Options.Separator separator,
Options.Multiplicity multiplicity)
Add a value option with the given key, separator, and multiplicity, possibly details, and the default prefix |
OptionSet |
addOption(String key,
Options.Multiplicity multiplicity)
Add a non-value option with the given key and multiplicity, and the default prefix |
OptionSet |
addOption(String key,
Options.Separator separator)
Add a value option with the given key and separator, no details, and the default prefix and multiplicity |
OptionSet |
addOption(String key,
Options.Separator separator,
Options.Multiplicity multiplicity)
Add a value option with the given key, separator, and multiplicity, no details, and the default prefix |
ArrayList<String> |
getData()
Return the data items found (these are the items on the command line which do not start with the prefix, i. |
int |
getMaxData()
Getter method for maxData property |
int |
getMinData()
Getter method for minData property |
OptionData |
getOption(String key)
Get the data for a specific option, identified by its key name (which is unique) |
ArrayList<OptionData> |
getOptionData()
Get a list of all the options defined for this set |
String |
getSetName()
Getter method for setName property |
ArrayList<String> |
getUnmatched()
Return all unmatched items found (these are the items on the command line which start with the prefix, but do not match to one of the options) |
boolean |
isSet(String key)
Check whether a specific option is set, i. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public ArrayList<OptionData> getOptionData()
OptionData
instances defined for this setpublic OptionData getOption(String key)
key
- The key for the option
OptionData
instance
IllegalArgumentException
- If the key
is null
or unknown in this setpublic boolean isSet(String key)
key
- The key for the option
true
or false
, depending on the outcome of the check
IllegalArgumentException
- If the key
is null
or unknown in this setpublic String getSetName()
setName
property
setName
propertypublic int getMinData()
minData
property
minData
propertypublic int getMaxData()
maxData
property
maxData
propertypublic ArrayList<String> getData()
public ArrayList<String> getUnmatched()
public OptionSet addOption(String key)
key
- The key for the option
addOption()
methods)
IllegalArgumentException
- If the key
is null
or a key with this name has already been definedpublic OptionSet addOption(String key, Options.Multiplicity multiplicity)
key
- The key for the optionmultiplicity
- The multiplicity for the option
addOption()
methods)
IllegalArgumentException
- If the key
is null
or a key with this name has already been defined
or if multiplicity
is null
public OptionSet addOption(String key, Options.Separator separator)
key
- The key for the optionseparator
- The separator for the option
addOption()
methods)
IllegalArgumentException
- If the key
is null
or a key with this name has already been defined
or if separator
is null
public OptionSet addOption(String key, Options.Separator separator, Options.Multiplicity multiplicity)
key
- The key for the optionseparator
- The separator for the optionmultiplicity
- The multiplicity for the option
addOption()
methods)
IllegalArgumentException
- If the key
is null
or a key with this name has already been defined
or if separator
or multiplicity
are null
public OptionSet addOption(String key, boolean details, Options.Separator separator)
key
- The key for the optiondetails
- A boolean indicating whether details are expected for the optionseparator
- The separator for the option
addOption()
methods)
IllegalArgumentException
- If the key
is null
or a key with this name has already been defined
or if separator
is null
public OptionSet addOption(String key, boolean details, Options.Separator separator, Options.Multiplicity multiplicity)
key
- The key for the optiondetails
- A boolean indicating whether details are expected for the optionseparator
- The separator for the optionmultiplicity
- The multiplicity for the option
addOption()
methods)
IllegalArgumentException
- If the key
is null
or a key with this name has already been defined
or if separator
or multiplicity
are null
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |