|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.freecol.common.model.FreeColObject
net.sf.freecol.common.model.Feature
net.sf.freecol.common.model.Ability
public final class Ability
The Ability class encapsulates a bonus or penalty
that can be applied to any action within the game, most obviously
combat.
| Field Summary | |
|---|---|
static java.lang.String |
ADD_TAX_TO_BELLS
|
private boolean |
value
|
| Fields inherited from class net.sf.freecol.common.model.FreeColObject |
|---|
ARRAY_SIZE, ID_ATTRIBUTE, ID_ATTRIBUTE_TAG, logger, PARTIAL_ATTRIBUTE |
| Constructor Summary | |
|---|---|
Ability(org.w3c.dom.Element element)
Creates a new Ability instance. |
|
Ability(java.lang.String id)
Creates a new Ability instance. |
|
Ability(java.lang.String id,
boolean value)
Creates a new Ability instance. |
|
Ability(java.lang.String id,
FreeColGameObjectType source,
boolean value)
Creates a new Ability instance. |
|
Ability(javax.xml.stream.XMLStreamReader in,
Specification specification)
Creates a new Ability instance. |
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object o)
|
boolean |
getValue()
Get the Value value. |
static java.lang.String |
getXMLElementTagName()
Returns the XML tag name for this element. |
int |
hashCode()
|
void |
readAttributes(javax.xml.stream.XMLStreamReader in,
Specification specification)
|
void |
setValue(boolean newValue)
Set the Value value. |
java.lang.String |
toString()
|
void |
toXMLImpl(javax.xml.stream.XMLStreamWriter out)
This method writes an XML-representation of this object to the given stream. |
void |
writeAttributes(javax.xml.stream.XMLStreamWriter out)
|
| Methods inherited from class net.sf.freecol.common.model.Feature |
|---|
appliesTo, appliesTo, getFirstTurn, getLastTurn, getScopes, getSource, hasScope, hasTimeLimit, isOutOfDate, readChildren, readFromXMLImpl, setFirstTurn, setLastTurn, setScopes, setSource, writeChildren |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String ADD_TAX_TO_BELLS
private boolean value
| Constructor Detail |
|---|
public Ability(java.lang.String id)
Ability instance.
id - a String value
public Ability(java.lang.String id,
boolean value)
Ability instance.
id - a String valuevalue - a boolean value
public Ability(java.lang.String id,
FreeColGameObjectType source,
boolean value)
Ability instance.
id - a String valuesource - a FreeColGameObjectType valuevalue - a boolean valuepublic Ability(org.w3c.dom.Element element)
Ability instance.
element - an Element value
public Ability(javax.xml.stream.XMLStreamReader in,
Specification specification)
throws javax.xml.stream.XMLStreamException
Ability instance.
in - a XMLStreamReader valuespecification - a Specification value
javax.xml.stream.XMLStreamException - if an error occurs| Method Detail |
|---|
public boolean getValue()
Value value.
boolean valuepublic void setValue(boolean newValue)
Value value.
newValue - The new Value value.public int hashCode()
hashCode in class Featurepublic boolean equals(java.lang.Object o)
equals in class Feature
public void toXMLImpl(javax.xml.stream.XMLStreamWriter out)
throws javax.xml.stream.XMLStreamException
toXMLImpl in class FreeColObjectout - The target stream.
javax.xml.stream.XMLStreamException - if there are any problems writing
to the stream.
public void readAttributes(javax.xml.stream.XMLStreamReader in,
Specification specification)
throws javax.xml.stream.XMLStreamException
readAttributes in class Featurejavax.xml.stream.XMLStreamException
public void writeAttributes(javax.xml.stream.XMLStreamWriter out)
throws javax.xml.stream.XMLStreamException
writeAttributes in class Featurejavax.xml.stream.XMLStreamExceptionpublic static java.lang.String getXMLElementTagName()
String valuepublic java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||