|
||||||||||
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 FormConstructor 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 Collection
add
in class AbstractMap
public void clear()
clear
in interface Collection
clear
in class AbstractMap
public int count(Class type)
count
in interface IAgentCollection
type
- Agent class.public IAgent findByName(String name)
findByName
in interface IAgentCollection
public IAgent findByTeam(ITeam team)
findByTeam
in interface IAgentCollection
public IAgent firstOpponent(IAgent agent)
firstOpponent
in interface IAgentCollection
agent
- Agent.public IAgent get(Class agentType)
public Iterator opponentIterator(IAgent agent)
opponentIterator
in interface IAgentCollection
agent
- The agent to omit from the iterator.public void propertyChange(PropertyChangeEvent event)
propertyChange
in interface PropertyChangeListener
public boolean remove(Object object)
remove
in interface Collection
remove
in class AbstractMap
protected Map getAgentToOpponents()
protected Map getData()
getData
in class AbstractMap
protected 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 |