|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.commons.cli.OptionGroup
public class OptionGroup
A group of mutually exclusive options.
| Field Summary | |
|---|---|
private java.util.HashMap |
optionMap
hold the options |
private boolean |
required
specified whether this group is required |
private java.lang.String |
selected
the name of the selected option |
| Constructor Summary | |
|---|---|
OptionGroup()
|
|
| Method Summary | |
|---|---|
OptionGroup |
addOption(Option opt)
add opt to this group |
java.util.Collection |
getNames()
|
java.util.Collection |
getOptions()
|
java.lang.String |
getSelected()
|
boolean |
isRequired()
Returns whether this option group is required. |
void |
setRequired(boolean required)
|
void |
setSelected(Option opt)
set the selected option of this group to name. |
java.lang.String |
toString()
Returns the stringified version of this OptionGroup. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private java.util.HashMap optionMap
private java.lang.String selected
private boolean required
| Constructor Detail |
|---|
public OptionGroup()
| Method Detail |
|---|
public OptionGroup addOption(Option opt)
opt to this group
opt - the option to add to this group
public java.util.Collection getNames()
Collectionpublic java.util.Collection getOptions()
Collection
public void setSelected(Option opt)
throws AlreadySelectedException
name.
opt - the option that is selected
AlreadySelectedException - if an option from this group has
already been selected.public java.lang.String getSelected()
public void setRequired(boolean required)
required - specifies if this group is requiredpublic boolean isRequired()
public java.lang.String toString()
Returns the stringified version of this OptionGroup.
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||