org.vizzini.game
Class TeamCollection

java.lang.Object
  extended by org.vizzini.util.AbstractCollection
      extended by org.vizzini.util.AbstractMap
          extended by org.vizzini.game.TeamCollection
All Implemented Interfaces:
PropertyChangeListener, Serializable, Cloneable, Iterable, Collection, EventListener, ITeamCollection, ICollection

public class TeamCollection
extends AbstractMap
implements ITeamCollection, PropertyChangeListener

Provides a collection to hold ITeam s. Each stored team's name must be unique, as the name is the only discriminating property.

Since:
v0.1
Version:
v0.2
Author:
Jeffrey M. Thompson
See Also:
ITeam, AbstractTeam.equals(Object), Serialized Form

Constructor Summary
TeamCollection()
           
 
Method Summary
 boolean add(Object object)
          Add the given object.
 ITeam findByName(String name)
          Return the team with the given name.
protected  Map getData()
          Return the data collection.
protected  Object getKey(Object object)
          Return the key for the given object.
protected  Class getType()
          Return the type this collection holds.
 int hashCode()
          Returns a hash code value for the object.
 void propertyChange(PropertyChangeEvent event)
          Implement a property change listener for relevant token properties.
 boolean remove(Object object)
          Add the given object.
 
Methods inherited from class org.vizzini.util.AbstractMap
clear, contains, equals, isEmpty, iterator, size, toString
 
Methods inherited from class org.vizzini.util.AbstractCollection
addAll, containsAll, removeAll, retainAll, toArray, toArray
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.vizzini.util.ICollection
toString
 
Methods inherited from interface java.util.Collection
addAll, clear, contains, containsAll, equals, isEmpty, iterator, removeAll, retainAll, size, toArray, toArray
 

Constructor Detail

TeamCollection

public TeamCollection()
Method Detail

add

public boolean add(Object object)
Add the given object. Extend the super method to add property listeners to the token.

Specified by:
add in interface Collection
Overrides:
add in class AbstractMap
Since:
v0.2

findByName

public ITeam findByName(String name)
Return the team with the given name.

Specified by:
findByName in interface ITeamCollection
Since:
v0.1

hashCode

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

Specified by:
hashCode in interface Collection
Overrides:
hashCode in class AbstractMap
Since:
v0.1

propertyChange

public void propertyChange(PropertyChangeEvent event)
Implement a property change listener for relevant token properties. This method re-maps a team if the team's name has changed.

Specified by:
propertyChange in interface PropertyChangeListener
Since:
v0.2

remove

public boolean remove(Object object)
Add the given object. Extend the super method to remove property listeners from the token.

Specified by:
remove in interface Collection
Overrides:
remove in class AbstractMap
Since:
v0.2

getData

protected Map getData()
Return the data collection.

Specified by:
getData in class AbstractMap
Since:
v0.1

getKey

protected Object getKey(Object object)
Return the key for the given object.

Specified by:
getKey in class AbstractMap
Since:
v0.1

getType

protected Class getType()
Return the type this collection holds.

Specified by:
getType in class AbstractCollection
Since:
v0.1


Copyright 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02