net.sf.freecol.server.control
Class ChangeSet.Change

java.lang.Object
  extended by net.sf.freecol.server.control.ChangeSet.Change
Direct Known Subclasses:
ChangeSet.AttackChange, ChangeSet.AttributeChange, ChangeSet.MessageChange, ChangeSet.MoveChange, ChangeSet.ObjectChange, ChangeSet.OwnedChange, ChangeSet.RemoveChange, ChangeSet.SpyChange, ChangeSet.StanceChange, ChangeSet.TrivialChange
Enclosing class:
ChangeSet

private abstract static class ChangeSet.Change
extends java.lang.Object


Field Summary
protected  ChangeSet.See see
           
 
Constructor Summary
ChangeSet.Change(ChangeSet.See see)
          Make a new Change.
 
Method Summary
 void attachToElement(org.w3c.dom.Element element)
          Some changes can not be directly specialized, but need to be directly attached to an element.
 java.util.List<ChangeSet.Change> consequences(ServerPlayer serverPlayer)
          Are the secondary changes consequent to this Change?
 boolean convertsToElement()
          Can this Change be directly converted to an Element?
 boolean isNotifiable(ServerPlayer serverPlayer)
          Should a player be notified of this Change?
 boolean isPerhapsNotifiable(ServerPlayer serverPlayer)
          Should a player be notified of a Change for which the visibility is delegated to the change type, allowing special change-specific overrides.
abstract  int sortPriority()
          The sort priority of a change, to be used by the changeComparator.
abstract  org.w3c.dom.Element toElement(ServerPlayer serverPlayer, org.w3c.dom.Document doc)
          Specialize a Change for a particular player.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

see

protected ChangeSet.See see
Constructor Detail

ChangeSet.Change

ChangeSet.Change(ChangeSet.See see)
Make a new Change.

Method Detail

sortPriority

public abstract int sortPriority()
The sort priority of a change, to be used by the changeComparator.


isNotifiable

public boolean isNotifiable(ServerPlayer serverPlayer)
Should a player be notified of this Change?

Parameters:
serverPlayer - The ServerPlayer to consider.
Returns:
True if this Change should be sent.

isPerhapsNotifiable

public boolean isPerhapsNotifiable(ServerPlayer serverPlayer)
Should a player be notified of a Change for which the visibility is delegated to the change type, allowing special change-specific overrides.

Parameters:
serverPlayer - The ServerPlayer to consider.
Returns:
False. This is the default, to be overridden as required.

consequences

public java.util.List<ChangeSet.Change> consequences(ServerPlayer serverPlayer)
Are the secondary changes consequent to this Change?

Parameters:
serverPlayer - The ServerPlayer to consider.
Returns:
A list of secondary Changes or the empty list if there are none, which is usually the case.

convertsToElement

public boolean convertsToElement()
Can this Change be directly converted to an Element?

Returns:
True if this change can be directly converted to an Element.

toElement

public abstract org.w3c.dom.Element toElement(ServerPlayer serverPlayer,
                                              org.w3c.dom.Document doc)
Specialize a Change for a particular player.

Parameters:
serverPlayer - The ServerPlayer to update.
doc - The owner Document to build the element in.
Returns:
An Element encapsulating this change.

attachToElement

public void attachToElement(org.w3c.dom.Element element)
Some changes can not be directly specialized, but need to be directly attached to an element.

Parameters:
element - The Element to attach to.