org.vizzini.game
Class AbstractTeam

java.lang.Object
  extended by org.vizzini.game.AbstractTeam
All Implemented Interfaces:
Serializable, ITeam
Direct Known Subclasses:
DefaultTeam

public abstract class AbstractTeam
extends Object
implements ITeam

Provides base functionality for teams in the game framework. A team instance represents one team of agents. Examples include the teams White and Black in chess, or partners in bridge. Teams may also have associated tokens.

Since:
v0.1
Version:
v0.3
Author:
Jeffrey M. Thompson
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.vizzini.game.ITeam
NAME_PROPERTY
 
Constructor Summary
AbstractTeam()
          Construct this object.
 
Method Summary
 void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
          Add a PropertyChangeListener for a specific property.
 void configure(Properties properties, int index)
          Configure this team.
 boolean equals(Object object)
          Return true if the given object is equal to this.
 IAgentCollection getAgentCollection()
          Return the agent collection.
 String getName()
          Return this agent's name.
protected  PropertyChangeManager getPropertyChangeManager()
          Return the property change manager.
 ITokenCollection getTokenCollection()
          Return the token collection.
 int hashCode()
          Returns a hash code value for the object.
 void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)
          Remove a PropertyChangeListener for a specific property.
 void reset()
          Reset to the initial state.
 void setName(String name)
          Set the name to the given name.
 String toString()
          Return a string representation of this object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractTeam

public AbstractTeam()
Construct this object.

Since:
v0.2
Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(String propertyName,
                                      PropertyChangeListener listener)
Add a PropertyChangeListener for a specific property. The listener will be invoked only when a call on firePropertyChange names that specific property.

Specified by:
addPropertyChangeListener in interface ITeam
Parameters:
propertyName - The name of the property to listen on.
listener - The PropertyChangeListener to be added.
Since:
v0.2

configure

public void configure(Properties properties,
                      int index)
               throws InstantiationException,
                      IllegalAccessException
Configure this team.

Specified by:
configure in interface ITeam
Parameters:
properties - Source of configuration information.
index - Index of this team's properties.
Throws:
InstantiationException
IllegalAccessException
Since:
v0.1

equals

public boolean equals(Object object)
Return true if the given object is equal to this.

Overrides:
equals in class Object
Parameters:
object - The object to compare.
Since:
v0.1

getAgentCollection

public IAgentCollection getAgentCollection()
Return the agent collection.

Specified by:
getAgentCollection in interface ITeam
Since:
v0.1

getName

public String getName()
Return this agent's name.

Specified by:
getName in interface ITeam
Since:
v0.1

getTokenCollection

public ITokenCollection getTokenCollection()
Return the token collection.

Specified by:
getTokenCollection in interface ITeam
Since:
v0.1

hashCode

public int hashCode()
Returns a hash code value for the object.

Overrides:
hashCode in class Object
Since:
v0.1

removePropertyChangeListener

public void removePropertyChangeListener(String propertyName,
                                         PropertyChangeListener listener)
Remove a PropertyChangeListener for a specific property.

Specified by:
removePropertyChangeListener in interface ITeam
Parameters:
propertyName - The name of the property that was listened on.
listener - The PropertyChangeListener to be removed.
Since:
v0.2

reset

public void reset()
Reset to the initial state.

Specified by:
reset in interface ITeam
Since:
v0.1

setName

public void setName(String name)
Set the name to the given name.

Specified by:
setName in interface ITeam
Parameters:
name - The new name.
Since:
v0.1

toString

public String toString()
Return a string representation of this object.

Overrides:
toString in class Object
Since:
v0.1

getPropertyChangeManager

protected PropertyChangeManager getPropertyChangeManager()
Return the property change manager.

Since:
v0.2


Copyright © 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02