net.sf.freecol.common.option
Class UnitListOption

java.lang.Object
  extended by net.sf.freecol.common.model.FreeColObject
      extended by net.sf.freecol.common.option.AbstractOption<java.util.List<AbstractOption<T>>>
          extended by net.sf.freecol.common.option.ListOption<AbstractUnit>
              extended by net.sf.freecol.common.option.UnitListOption
All Implemented Interfaces:
java.lang.Cloneable, Option<java.util.List<AbstractOption<AbstractUnit>>>

public class UnitListOption
extends ListOption<AbstractUnit>

Represents an option where the valid choice is a list of AbstractUnits, e.g. the units of the REF.


Field Summary
 
Fields inherited from class net.sf.freecol.common.option.AbstractOption
isDefined
 
Fields inherited from class net.sf.freecol.common.model.FreeColObject
ARRAY_SIZE, ID_ATTRIBUTE, ID_ATTRIBUTE_TAG, INFINITY, NO_ID, PARTIAL_ATTRIBUTE, UNDEFINED, VALUE_TAG
 
Constructor Summary
UnitListOption(Specification specification)
          Creates a new UnitListOption.
UnitListOption(java.lang.String id)
          Creates a new UnitListOption.
 
Method Summary
static java.lang.String getXMLElementTagName()
          Gets the tag name of the root element representing this object.
protected  void toXMLImpl(javax.xml.stream.XMLStreamWriter out)
          This method writes an XML-representation of this object to the given stream.
 
Methods inherited from class net.sf.freecol.common.option.ListOption
clone, getMaximumValue, getOptionValues, getTemplate, getValue, isNullValueOK, readFromXMLImpl, setMaximumValue, setTemplate, setValue, toXMLImpl
 
Methods inherited from class net.sf.freecol.common.option.AbstractOption
generateChoices, getGroup, readAttributes, readOption, setGroup, setValue, setValues
 
Methods inherited from class net.sf.freecol.common.model.FreeColObject
addPropertyChangeListener, addPropertyChangeListener, dumpObject, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getId, getPropertyChangeListeners, getPropertyChangeListeners, getSpecification, hasAbility, hasAttribute, hasListeners, readAttributes, readChild, readChild, readChildren, readChildren, readFromArrayElement, readFromArrayElement, readFromListElement, readFromXML, readFromXMLElement, readFromXMLImpl, readFromXMLPartialImpl, removePropertyChangeListener, removePropertyChangeListener, save, save, setId, setSpecification, toXML, toXML, toXML, toXMLElement, toXMLElement, toXMLElement, toXMLElement, toXMLElementPartial, toXMLPartialImpl, writeAttribute, writeAttributes, writeChildren
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.freecol.common.option.Option
getId, readFromXML, toString, toXML
 

Constructor Detail

UnitListOption

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

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

UnitListOption

public UnitListOption(Specification specification)
Creates a new UnitListOption.

Parameters:
specification - The specification this option belongs to. May be null.
Method Detail

toXMLImpl

protected void toXMLImpl(javax.xml.stream.XMLStreamWriter out)
                  throws javax.xml.stream.XMLStreamException
Description copied from class: ListOption
This method writes an XML-representation of this object to the given stream.

Overrides:
toXMLImpl in class ListOption<AbstractUnit>
Parameters:
out - The target stream.
Throws:
javax.xml.stream.XMLStreamException - if there are any problems writing to the stream.

getXMLElementTagName

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

Returns:
"unitListOption".