public class OptionGroup
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
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 and Description |
|---|
OptionGroup() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
private java.util.HashMap optionMap
private java.lang.String selected
private boolean required
public OptionGroup addOption(Option opt)
opt to this groupopt - the option to add to this grouppublic java.util.Collection getNames()
Collectionpublic java.util.Collection getOptions()
Collectionpublic void setSelected(Option opt) throws AlreadySelectedException
name.opt - the option that is selectedAlreadySelectedException - 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