public class AgentList
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
java.util.List |
agents |
Constructor and Description |
---|
AgentList()
Default constructor for the class AgentList
|
Modifier and Type | Method and Description |
---|---|
void |
addAgent(Agent agent)
Add an agent to the list.
|
java.util.Iterator |
getAgents() |
int |
getPos(java.lang.String agName)
Gives back the position inside the agents
|
boolean |
isPresent(java.lang.String agName)
Verifies if an agent is present on the canvas
|
void |
removeAgent(java.lang.String agentName)
Removes an agent from the list
|
void |
removeAllAgents()
Clears the agent list
|
int |
size() |
public void addAgent(Agent agent)
agent
- the agent to addpublic void removeAgent(java.lang.String agentName)
agentName
- name of the agent to removepublic void removeAllAgents()
public boolean isPresent(java.lang.String agName)
agName
- name of the agent to check forpublic int getPos(java.lang.String agName)
agName
- name of the agent for its position to searchpublic java.util.Iterator getAgents()
public int size()