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

public final 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.
 
Fields inherited from class net.sf.freecol.common.model.FreeColObject
ARRAY_SIZE, ID_ATTRIBUTE, ID_ATTRIBUTE_TAG, logger, PARTIAL_ATTRIBUTE
 
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()
           
 int hashCode()
           
 boolean isAbilityValue()
          Get the AbilityValue value.
 boolean isMatchesNull()
          Get the MatchesNull value.
 boolean isMatchNegated()
          Get the MatchNegated value.
 void readFromXMLImpl(javax.xml.stream.XMLStreamReader in)
          Initialize this object from an XML-representation of this object.
 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.
 
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, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

type

private java.lang.String type
The ID of a FreeColGameObjectType.


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

readFromXMLImpl

public 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 FreeColObject
Parameters:
in - The input stream with the XML.
Throws:
javax.xml.stream.XMLStreamException - if a problem was encountered during parsing.

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.

getXMLElementTagName

public static java.lang.String getXMLElementTagName()