net.sf.freecol.common.option
Class PercentageOption
java.lang.Object
net.sf.freecol.common.model.FreeColObject
net.sf.freecol.common.option.AbstractOption
net.sf.freecol.common.option.IntegerOption
net.sf.freecol.common.option.PercentageOption
- All Implemented Interfaces:
- Option
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 |
readFromXMLImpl(javax.xml.stream.XMLStreamReader in)
Initialize this object from an XML-representation of 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.model.FreeColObject |
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAttribute, getAttribute, getAttribute, getAttribute, getId, getPropertyChangeListeners, getPropertyChangeListeners, hasAbility, hasAttribute, hasListeners, readAttributes, readChildren, readFromArrayElement, readFromArrayElement, readFromArrayElement, readFromListElement, readFromXML, readFromXMLElement, readFromXMLPartialImpl, removePropertyChangeListener, removePropertyChangeListener, setId, toArrayElement, toArrayElement, toListElement, toXML, toXML, toXML, toXMLElement, toXMLElement, toXMLElement, toXMLElement, toXMLElementPartial, toXMLPartialImpl, writeAttribute, writeAttributes, writeChildren, writeFreeColGameObject |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
logger
private static java.util.logging.Logger logger
PercentageOption
public PercentageOption(javax.xml.stream.XMLStreamReader in)
throws javax.xml.stream.XMLStreamException
- Creates a new
RangeOption.
- Parameters:
in - The XMSStreamReader to read the data from
- Throws:
javax.xml.stream.XMLStreamException
PercentageOption
public PercentageOption(java.lang.String id,
OptionGroup optionGroup,
int defaultOption)
- Creates a new
RangeOption.
- Parameters:
id - The identifier for this option. This is used when the object
should be found in an OptionGroup.optionGroup - The OptionGroup this Option belongs to.defaultOption - The default value.
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.
readFromXMLImpl
protected void readFromXMLImpl(javax.xml.stream.XMLStreamReader in)
throws javax.xml.stream.XMLStreamException
- Initialize this object from an XML-representation of this object.
- Overrides:
readFromXMLImpl in class IntegerOption
- Parameters:
in - The input stream with the XML.
- Throws:
javax.xml.stream.XMLStreamException - if a problem was encountered
during parsing.
getXMLElementTagName
public static java.lang.String getXMLElementTagName()
- Gets the tag name of the root element representing this object.
- Returns:
- "percentageOption".