public class ComponentList
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
ComponentList()
Default constructor for the agent list.
|
Modifier and Type | Method and Description |
---|---|
void |
addAgent(Component agent)
Adds an agent to the list.
|
protected void |
addListener(IComponentListListener listener)
Register for agent events.
|
boolean |
containsAgent(Component agent)
Checks if an agent is contained in the agent list.
|
protected void |
fireAgentsAdded(Component[] agents)
Notifies the listeners about the adding of agents.
|
protected void |
fireAgentsChanged(Component[] agents)
Notifies the listeners about agents with changed visibility.
|
protected void |
fireAgentsRemoved(Component[] agents)
Notifies the listeners about the removal of agents.
|
Component |
getAgent(jadex.bridge.IComponentIdentifier aid)
Returns the agent from the list with the same identifier
|
Component[] |
getAgents() |
java.util.List |
getList() |
java.util.Iterator |
iterator() |
void |
removeAgent(Component agent) |
void |
removeAllAgents()
Clears the agent list and notifies all listeners
|
int |
size() |
public void addAgent(Component agent)
agent
- The agent to add.public void removeAgent(Component agent)
agent
- The agent to remove.public void removeAllAgents()
public java.util.List getList()
public Component[] getAgents()
public boolean containsAgent(Component agent)
agent
- The agent to check.true
if a specific agent is in the agentlist.public Component getAgent(jadex.bridge.IComponentIdentifier aid)
aid
- The agent identifier.null
if there is no agent with the
same identifier in the list.public java.util.Iterator iterator()
public int size()
protected void addListener(IComponentListListener listener)
listener
- A class implementing the IAgentListListener interface.protected void fireAgentsRemoved(Component[] agents)
agents
- The removed agents.protected void fireAgentsAdded(Component[] agents)
agents
- The added agents.protected void fireAgentsChanged(Component[] agents)
agents
- The changed agents.