|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.vizzini.util.AbstractCollection
org.vizzini.util.AbstractMap
org.vizzini.game.AgentCollection
public class AgentCollection
Provides a collection to hold IAgent s. Each stored agent's name
and team combination must be unique, as name and team are the only
discriminating properties.
IAgent,
AbstractAgent.equals(Object),
Serialized Form| Constructor Summary | |
|---|---|
AgentCollection()
|
|
| Method Summary | |
|---|---|
boolean |
add(Object object)
Add the given object. |
void |
clear()
Removes all of the objects from this collection. |
int |
count(Class type)
Return the count of agents in this collection of the given type. |
IAgent |
findByName(String name)
Return the agent with the given name. |
IAgent |
findByTeam(ITeam team)
Return the first agent with the given team. |
IAgent |
firstOpponent(IAgent agent)
Return the first found agent opponent to the given agent. |
IAgent |
get(Class agentType)
Return the first agent found of the given type. |
protected Map |
getAgentToOpponents()
Return the map of agents to opponents. |
protected Map |
getData()
Return the data collection. |
protected Object |
getKey(Object object)
Return the agent key. |
protected Object |
getKey(String name,
String teamName)
Return the agent key. |
protected Class |
getType()
Return the type this collection holds. |
Iterator |
opponentIterator(IAgent agent)
Return an iterator over all the agents excepting the given agent. |
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 |
|---|
contains, equals, hashCode, 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, contains, containsAll, equals, hashCode, isEmpty, iterator, removeAll, retainAll, size, toArray, toArray |
| Constructor Detail |
|---|
public AgentCollection()
| Method Detail |
|---|
public boolean add(Object object)
add in interface Collectionadd in class AbstractMappublic void clear()
clear in interface Collectionclear in class AbstractMappublic int count(Class type)
count in interface IAgentCollectiontype - Agent class.public IAgent findByName(String name)
findByName in interface IAgentCollectionpublic IAgent findByTeam(ITeam team)
findByTeam in interface IAgentCollectionpublic IAgent firstOpponent(IAgent agent)
firstOpponent in interface IAgentCollectionagent - Agent.public IAgent get(Class agentType)
public Iterator opponentIterator(IAgent agent)
opponentIterator in interface IAgentCollectionagent - The agent to omit from the iterator.public void propertyChange(PropertyChangeEvent event)
propertyChange in interface PropertyChangeListenerpublic boolean remove(Object object)
remove in interface Collectionremove in class AbstractMapprotected Map getAgentToOpponents()
protected Map getData()
getData in class AbstractMapprotected Object getKey(Object object)
getKey in class AbstractMap
protected Object getKey(String name,
String teamName)
protected Class getType()
getType in class AbstractCollection
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
| Copyright © 2007 Vizzini.org. All Rights Reserved. | 2007.12.25.03.00.02 |