Package net.sf.freecol.common.option
Class PercentageOption
- java.lang.Object
-
- net.sf.freecol.common.model.FreeColObject
-
- net.sf.freecol.common.model.FreeColSpecObject
-
- 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
,java.lang.Comparable<FreeColObject>
,ObjectWithId
,Option<java.lang.Integer>
public class PercentageOption extends IntegerOption
Represents an option where the result is a value between 0 and 100.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.logging.Logger
logger
static java.lang.String
TAG
-
Fields inherited from class net.sf.freecol.common.option.AbstractOption
ACTION_TAG, DEFAULT_VALUE_TAG, isDefined
-
Fields inherited from class net.sf.freecol.common.model.FreeColObject
ARRAY_SIZE_TAG, DEFAULT_CLASS_INDEX, fcoComparator, ID_ATTRIBUTE_TAG, PARTIAL_ATTRIBUTE_TAG, VALUE_TAG
-
-
Constructor Summary
Constructors Constructor Description PercentageOption(java.lang.String id, Specification specification)
Creates a newPercentageOption
.PercentageOption(Specification specification)
Creates a newPercentageOption
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getXMLTagName()
Get the serialization tag for this object.java.lang.String
toString()
-
Methods inherited from class net.sf.freecol.common.option.IntegerOption
cloneOption, getMaximumValue, getMinimumValue, getStepSize, getValue, limitValue, readAttributes, setMaximumValue, setMinimumValue, setValue, setValue, writeAttributes
-
Methods inherited from class net.sf.freecol.common.option.AbstractOption
generateChoices, getEnabledBy, getGroup, isNullValueOK, readOption, setGroup, setValues
-
Methods inherited from class net.sf.freecol.common.model.FreeColSpecObject
copyIn, getSpecification, setSpecification
-
Methods inherited from class net.sf.freecol.common.model.FreeColObject
addAbility, addFeatures, addModifier, addPropertyChangeListener, addPropertyChangeListener, apply, apply, applyModifiers, applyModifiers, arrayKey, compareIds, compareTo, containsAbilityKey, containsModifierKey, copy, copy, copy, copy, copyInCast, dumpObject, equals, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAbilities, getAbilities, getAbilities, getAbilities, getClassIndex, getDefenceModifiers, getDisplayObject, getFeatureContainer, getFreeColObjectClass, getFreeColObjectClassByName, getGame, getId, getIdNumber, getIdType, getIdTypeByName, getModifiers, getModifiers, getModifiers, getModifiers, getObjectClassIndex, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeSupport, getSortedAbilities, getSortedModifiers, getSuffix, getSuffix, hasAbility, hasAbility, hasAbility, hashCode, hasListeners, hasModifier, hasModifier, hasModifier, idEquals, invokeMethod, logFreeColObjects, readChild, readChildren, readFromXML, readFromXMLPartial, removeAbilities, removeAbility, removeFeatures, removeModifier, removeModifiers, removePropertyChangeListener, removePropertyChangeListener, save, save, save, save, serialize, serialize, serialize, serialize, setGame, setId, toXML, toXML, toXMLPartial, toXMLPartial, writeChildren
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.sf.freecol.common.ObjectWithId
getId
-
Methods inherited from interface net.sf.freecol.common.option.Option
readFromXML, toXML
-
-
-
-
Field Detail
-
logger
private static final java.util.logging.Logger logger
-
TAG
public static final java.lang.String TAG
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PercentageOption
public PercentageOption(Specification specification)
Creates a newPercentageOption
.- Parameters:
specification
- TheSpecification
to refer to.
-
PercentageOption
public PercentageOption(java.lang.String id, Specification specification)
Creates a newPercentageOption
.- Parameters:
id
- The object identifier.specification
- TheSpecification
to refer to.
-
-
Method Detail
-
getXMLTagName
public java.lang.String getXMLTagName()
Description copied from class:IntegerOption
Get the serialization tag for this object.- Overrides:
getXMLTagName
in classIntegerOption
- Returns:
- The tag.
-
toString
public java.lang.String toString()
- Specified by:
toString
in interfaceOption<java.lang.Integer>
- Overrides:
toString
in classIntegerOption
-
-