net.sf.freecol.common.option
Class PercentageOption
java.lang.Object
net.sf.freecol.common.model.FreeColObject
net.sf.freecol.common.option.AbstractOption<java.lang.Integer>
net.sf.freecol.common.option.IntegerOption
net.sf.freecol.common.option.PercentageOption
- All Implemented Interfaces:
- java.lang.Cloneable, Option<java.lang.Integer>
public class PercentageOption
- extends IntegerOption
Represents an option where the result is a value between 0 and 100.
|
Field Summary |
private static java.util.logging.Logger |
logger
|
|
Method Summary |
static java.lang.String |
getXMLElementTagName()
Gets the tag name of the root element representing this object. |
protected void |
readAttributes(javax.xml.stream.XMLStreamReader in)
Reads the attributes of this object from an XML stream. |
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.IntegerOption |
clone, getMaximumValue, getMinimumValue, getStringValue, getValue, setMaximumValue, setMinimumValue, setValue, setValue, setValue, toString, toXMLImpl |
| 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, wait, wait, wait |
logger
private static java.util.logging.Logger logger
PercentageOption
public PercentageOption(Specification specification)
- Creates a new
PercentageOption.
- Parameters:
specification - The specification this option belongs
to. May be null.
readAttributes
protected void readAttributes(javax.xml.stream.XMLStreamReader in)
throws javax.xml.stream.XMLStreamException
- Reads the attributes of this object from an XML stream.
- Overrides:
readAttributes in class IntegerOption
- Parameters:
in - The XML input stream.
- Throws:
javax.xml.stream.XMLStreamException - if a problem was encountered
during parsing.
toXMLImpl
protected void toXMLImpl(javax.xml.stream.XMLStreamWriter out)
throws javax.xml.stream.XMLStreamException
- This method writes an XML-representation of this object to the given
stream.
- Overrides:
toXMLImpl in class IntegerOption
- 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:
- "percentageOption".