net.sf.freecol.common.option
Class OptionGroup

java.lang.Object
  extended by net.sf.freecol.common.model.FreeColObject
      extended by net.sf.freecol.common.option.AbstractOption
          extended by net.sf.freecol.common.option.OptionGroup
All Implemented Interfaces:
Option
Direct Known Subclasses:
ActionManager, OptionMap

public class OptionGroup
extends AbstractOption

Used for grouping objects of Options.


Field Summary
 
Fields inherited from class net.sf.freecol.common.option.AbstractOption
NO_ID
 
Fields inherited from class net.sf.freecol.common.model.FreeColObject
ID_ATTRIBUTE_TAG
 
Constructor Summary
OptionGroup()
          Creates a new OptionGroup.
OptionGroup(java.lang.String id)
          Creates a new OptionGroup.
OptionGroup(javax.xml.stream.XMLStreamReader in)
          Creates a new OptionGroup.
 
Method Summary
 void add(Option option)
          Adds the given Option.
 java.lang.String getName()
          Returns the name of this Option.
 java.lang.String getShortDescription()
          Gives a short description of this Option.
static java.lang.String getXMLElementTagName()
          Gets the tag name of the root element representing this object.
 java.util.Iterator<Option> iterator()
          Returns an Iterator for the Options.
 void removeAll()
          Removes all of the Options from this OptionGroup.
 
Methods inherited from class net.sf.freecol.common.option.AbstractOption
getGroup, isPreviewEnabled, setGroup, setPreviewEnabled, toString
 
Methods inherited from class net.sf.freecol.common.model.FreeColObject
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAttribute, getAttribute, getAttribute, getAttribute, getId, getPropertyChangeListeners, getPropertyChangeListeners, hasAbility, hasAttribute, hasListeners, readFromXML, readFromXMLElement, removePropertyChangeListener, removePropertyChangeListener, toXML, toXML, toXML, toXMLElement, toXMLElement, toXMLElement, toXMLElement, toXMLElementPartial, writeAttribute, writeFreeColGameObject
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sf.freecol.common.option.Option
addPropertyChangeListener, getId, readFromXML, readFromXMLElement, removePropertyChangeListener, toXML, toXMLElement
 

Constructor Detail

OptionGroup

public OptionGroup()
Creates a new OptionGroup.


OptionGroup

public OptionGroup(java.lang.String id)
Creates a new OptionGroup.

Parameters:
id - The identifier for this option. This is used when the object should be found in an OptionGroup.

OptionGroup

public OptionGroup(javax.xml.stream.XMLStreamReader in)
            throws javax.xml.stream.XMLStreamException
Creates a new OptionGroup.

Parameters:
in - The XMLStreamReader containing the data.
Throws:
javax.xml.stream.XMLStreamException
Method Detail

add

public void add(Option option)
Adds the given Option.

Parameters:
option - The Option that should be added to this OptionGroup.

removeAll

public void removeAll()
Removes all of the Options from this OptionGroup.


iterator

public java.util.Iterator<Option> iterator()
Returns an Iterator for the Options.

Returns:
The Iterator.

getXMLElementTagName

public static java.lang.String getXMLElementTagName()
Gets the tag name of the root element representing this object.

Returns:
"optionGroup".

getName

public java.lang.String getName()
Returns the name of this Option.

Specified by:
getName in interface Option
Overrides:
getName in class AbstractOption
Returns:
The name as provided in the constructor.

getShortDescription

public java.lang.String getShortDescription()
Gives a short description of this Option. Can for instance be used as a tooltip text.

Specified by:
getShortDescription in interface Option
Overrides:
getShortDescription in class AbstractOption
Returns:
A short description of this Option.