PkgAgentSystem
Class AgentIDStore
java.lang.Object
|
+--PkgAgentSystem.AgentIDStore
- class AgentIDStore
- extends Object
Used for storing the IDs of the agents which denied moving or persisting and requested some time.
- Version:
- 1.0, 1.7.2000
- Author:
- Michael Sonntag
- See Also:
AgentSystem
Constructor Summary |
AgentIDStore()
Creates a new and empty store for agents |
Method Summary |
void |
add(long id,
AgentBase agent,
Object parameter)
Add an agent with a certain id and an optional parameter to the store |
AgentBase |
get(long id)
Returns the agent for a certain id |
Object |
getParameter(long id)
Returns the optional parameter for a certain id |
void |
remove(AgentBase agent)
Removes all stored data on an agent from the store |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AgentIDStore
public AgentIDStore()
- Creates a new and empty store for agents
remove
public void remove(AgentBase agent)
- Removes all stored data on an agent from the store
- Parameters:
agent
- the agent whose elements are to be removed
add
public void add(long id,
AgentBase agent,
Object parameter)
- Add an agent with a certain id and an optional parameter to the store
- Parameters:
id
- the id for this data (must be unique for the store)agent
- the agentparameter
- the optional data- Throws:
IllegalArgumentException
- if this id is already in the store
get
public AgentBase get(long id)
- Returns the agent for a certain id
- Parameters:
id
- the id for which the agent shall be returned- Returns:
- the agent for this id or null if the id is not in the store
- Throws:
IllegalArgumentException
- if this id is not in the store
getParameter
public Object getParameter(long id)
- Returns the optional parameter for a certain id
- Parameters:
id
- the id for which the parameter shall be returned- Returns:
- the paremeter for this id or null if no parameter was set
- Throws:
IllegalArgumentException
- if this id is not in the store
Submit a bug
Copyright 2001,2002 Michael Sonntag & Institute for Information Processing and Microprocessor Technology (FIM), Johannes-Kepler-University Linz, Altenbergerstr. 69, A-4040 Linz, Austria.