net.sf.freecol.common.model
Class Scope

java.lang.Object
  extended by net.sf.freecol.common.model.FreeColObject
      extended by net.sf.freecol.common.model.Scope
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
Operand

public class Scope
extends FreeColObject
implements java.lang.Cloneable

The Scope class determines whether a given FreeColGameObjectType fulfills certain requirements.


Field Summary
private  java.lang.String abilityID
          The ID of an Ability.
private  boolean abilityValue
          The value of an Ability.
private  boolean matchesNull
          True if the scope applies to a null object.
private  boolean matchNegated
          Whether the match is negated.
private  java.lang.String methodName
          The name of an Method.
private  java.lang.String methodValue
          The String representation of the value of an Method.
private  java.lang.String type
          The ID of a FreeColGameObjectType, or Option.
 
Fields inherited from class net.sf.freecol.common.model.FreeColObject
ARRAY_SIZE, ID_ATTRIBUTE, ID_ATTRIBUTE_TAG, INFINITY, logger, NO_ID, PARTIAL_ATTRIBUTE, UNDEFINED, VALUE_TAG
 
Constructor Summary
Scope()
          Creates a new Scope instance.
Scope(javax.xml.stream.XMLStreamReader in)
          Creates a new Scope instance.
 
Method Summary
 boolean appliesTo(FreeColObject object)
          Describe appliesTo method here.
 boolean equals(java.lang.Object o)
           
 java.lang.String getAbilityID()
          Get the AbilityID value.
 java.lang.String getMethodName()
          Get the MethodName value.
 java.lang.String getMethodValue()
          Get the MethodValue value.
 java.lang.String getType()
          Get the Type value.
static java.lang.String getXMLElementTagName()
          Gets the tag name of the root element representing this object.
 int hashCode()
           
 boolean isAbilityValue()
          Get the AbilityValue value.
 boolean isMatchesNull()
          Get the MatchesNull value.
 boolean isMatchNegated()
          Get the MatchNegated value.
protected  void readAttributes(javax.xml.stream.XMLStreamReader in)
          Reads the attributes of this object from an XML stream.
 void setAbilityID(java.lang.String newAbilityID)
          Set the AbilityID value.
 void setAbilityValue(boolean newAbilityValue)
          Set the AbilityValue value.
 void setMatchesNull(boolean newMatchesNull)
          Set the MatchesNull value.
 void setMatchNegated(boolean newMatchNegated)
          Set the MatchNegated value.
 void setMethodName(java.lang.String newMethodName)
          Set the MethodName value.
 void setMethodValue(java.lang.String newMethodValue)
          Set the MethodValue value.
 void setType(java.lang.String newType)
          Set the Type value.
 void toXMLImpl(javax.xml.stream.XMLStreamWriter out)
          This method writes an XML-representation of this object to the given stream.
protected  void writeAttributes(javax.xml.stream.XMLStreamWriter out)
          Write the attributes of this object to a stream.
 
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, readFromXMLImpl, readFromXMLPartialImpl, removePropertyChangeListener, removePropertyChangeListener, save, save, setId, setSpecification, toXML, toXML, toXML, toXMLElement, toXMLElement, toXMLElement, toXMLElement, toXMLElementPartial, toXMLPartialImpl, writeAttribute, writeChildren
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

type

private java.lang.String type
The ID of a FreeColGameObjectType, or Option.


abilityID

private java.lang.String abilityID
The ID of an Ability.


abilityValue

private boolean abilityValue
The value of an Ability.


methodName

private java.lang.String methodName
The name of an Method.


methodValue

private java.lang.String methodValue
The String representation of the value of an Method.


matchesNull

private boolean matchesNull
True if the scope applies to a null object.


matchNegated

private boolean matchNegated
Whether the match is negated.

Constructor Detail

Scope

public Scope()
Creates a new Scope instance.


Scope

public Scope(javax.xml.stream.XMLStreamReader in)
      throws javax.xml.stream.XMLStreamException
Creates a new Scope instance.

Parameters:
in - a XMLStreamReader value
Throws:
javax.xml.stream.XMLStreamException - if an error occurs
Method Detail

isMatchesNull

public boolean isMatchesNull()
Get the MatchesNull value.

Returns:
a boolean value

setMatchesNull

public void setMatchesNull(boolean newMatchesNull)
Set the MatchesNull value.

Parameters:
newMatchesNull - The new MatchesNull value.

isMatchNegated

public boolean isMatchNegated()
Get the MatchNegated value.

Returns:
a boolean value

setMatchNegated

public void setMatchNegated(boolean newMatchNegated)
Set the MatchNegated value.

Parameters:
newMatchNegated - The new MatchNegated value.

getType

public java.lang.String getType()
Get the Type value.

Returns:
a String value

setType

public void setType(java.lang.String newType)
Set the Type value.

Parameters:
newType - The new Type value.

getAbilityID

public java.lang.String getAbilityID()
Get the AbilityID value.

Returns:
a String value

setAbilityID

public void setAbilityID(java.lang.String newAbilityID)
Set the AbilityID value.

Parameters:
newAbilityID - The new AbilityID value.

isAbilityValue

public boolean isAbilityValue()
Get the AbilityValue value.

Returns:
a boolean value

setAbilityValue

public void setAbilityValue(boolean newAbilityValue)
Set the AbilityValue value.

Parameters:
newAbilityValue - The new AbilityValue value.

getMethodName

public java.lang.String getMethodName()
Get the MethodName value.

Returns:
a String value

setMethodName

public void setMethodName(java.lang.String newMethodName)
Set the MethodName value.

Parameters:
newMethodName - The new MethodName value.

getMethodValue

public java.lang.String getMethodValue()
Get the MethodValue value.

Returns:
an String value

setMethodValue

public void setMethodValue(java.lang.String newMethodValue)
Set the MethodValue value.

Parameters:
newMethodValue - The new MethodValue value.

appliesTo

public boolean appliesTo(FreeColObject object)
Describe appliesTo method here.

Parameters:
object - a FreeColGameObjectType value
Returns:
a boolean value

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

toXMLImpl

public 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.

Specified by:
toXMLImpl in class FreeColObject
Parameters:
out - The target stream.
Throws:
javax.xml.stream.XMLStreamException - if there are any problems writing to the stream.

writeAttributes

protected void writeAttributes(javax.xml.stream.XMLStreamWriter out)
                        throws javax.xml.stream.XMLStreamException
Write the attributes of this object to a stream.

Overrides:
writeAttributes in class FreeColObject
Parameters:
out - The target stream.
Throws:
javax.xml.stream.XMLStreamException - if there are any problems writing to the stream.

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 FreeColObject
Parameters:
in - The XML input stream.
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:
"scope".