|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ix.ispace.ContactManager
public class ContactManager
Keeps track of known relationships between agents and agent capabilities.
Field Summary | |
---|---|
protected java.util.List |
agentData
|
protected ColorGenerator |
colorGen
|
protected java.util.List |
groups
|
protected java.util.List |
listeners
|
protected java.util.Map |
nameToGroup
|
protected MultiMap |
relMap
|
Constructor Summary | |
---|---|
ContactManager()
|
Method Summary | |
---|---|
void |
addAgent(java.lang.String name)
Adds the agent as a contact. |
void |
addAgent(java.lang.String name,
AgentRelationship rel)
Adds the agent, recording it as having the specified relationship to this agent. |
void |
addAgentGroup(AgentGroup group)
|
void |
addAgents(java.util.List names,
AgentRelationship rel)
Adds the agents by calling addAgent(String, AgentRelationship) . |
void |
addContactListener(ContactListener listener)
|
protected void |
addStandardAgentGroups()
|
void |
changeRelationship(java.lang.String name,
AgentRelationship newRel)
|
void |
deleteAgent(java.lang.String name)
|
boolean |
ensureAgent(java.lang.String name,
AgentRelationship rel)
Ensures that the agent is recorded as having the specified relationship to this agent. |
void |
fireContactChange(AgentData oldData,
AgentData newData)
|
void |
fireContactDeleted(AgentData data)
|
void |
fireContactEvent(ContactEvent event)
|
void |
fireNewContact(AgentData data)
|
java.awt.Color |
getAgentColor(java.lang.String name)
|
java.awt.Color |
getAgentColor(java.lang.String name,
java.awt.Color defaultColor)
|
java.util.List |
getAgentData()
|
java.util.List |
getAgentData(AgentRelationship rel)
|
java.util.List |
getAgentData(Capability c)
|
java.util.List |
getAgentData(Capability c,
boolean defaultIfUnknown)
|
AgentData |
getAgentData(java.lang.String name)
|
AgentGroup |
getAgentGroup(java.lang.String name)
|
java.util.Collection |
getAgentGroups()
|
java.util.List |
getSortedNameList()
|
void |
noteAgent(java.lang.String name)
Record the agent as a contact if it is not already known. |
void |
noteAgent(java.lang.String name,
AgentRelationship assumedRel)
Record the agent as having the specified relationship to this agent, if the agent is not already known. |
void |
processCommandLineArguments()
Process command-line arguments that are about our relationships with other agents. |
protected void |
replaceAgentData(AgentData oldData,
AgentData newData)
|
void |
setAgentColor(java.lang.String name,
java.awt.Color color)
|
void |
setCapabilities(java.lang.String name,
java.util.List newCapabilities)
|
protected void |
warnAboutQuestionableAgentNames(java.util.List names,
AgentRelationship rel)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.List listeners
protected java.util.List agentData
protected MultiMap relMap
protected java.util.List groups
protected java.util.Map nameToGroup
protected ColorGenerator colorGen
Constructor Detail |
---|
public ContactManager()
Method Detail |
---|
public void addAgent(java.lang.String name)
AssertionFailure
- if the agent is already known.addAgent(String, AgentRelationship)
public void addAgent(java.lang.String name, AgentRelationship rel)
AssertionFailure
- if the agent is already known.public void addAgents(java.util.List names, AgentRelationship rel)
addAgent(String, AgentRelationship)
.
AssertionFailure
- if any of the agents is already known.noteAgent(String, AgentRelationship)
,
ensureAgent(String, AgentRelationship)
public void noteAgent(java.lang.String name)
noteAgent(String, AgentRelationship)
public void noteAgent(java.lang.String name, AgentRelationship assumedRel)
addAgent(String, AgentRelationship)
,
ensureAgent(String, AgentRelationship)
public boolean ensureAgent(java.lang.String name, AgentRelationship rel)
noteAgent(String, AgentRelationship)
,
addAgent(String, AgentRelationship)
,
changeRelationship(String, AgentRelationship)
public java.util.List getAgentData()
public AgentData getAgentData(java.lang.String name)
public java.util.List getAgentData(AgentRelationship rel)
public java.util.List getAgentData(Capability c)
public java.util.List getAgentData(Capability c, boolean defaultIfUnknown)
public java.util.List getSortedNameList()
protected void replaceAgentData(AgentData oldData, AgentData newData)
public void changeRelationship(java.lang.String name, AgentRelationship newRel)
public void deleteAgent(java.lang.String name)
public void setCapabilities(java.lang.String name, java.util.List newCapabilities)
public java.awt.Color getAgentColor(java.lang.String name)
public java.awt.Color getAgentColor(java.lang.String name, java.awt.Color defaultColor)
public void setAgentColor(java.lang.String name, java.awt.Color color)
public java.util.Collection getAgentGroups()
public AgentGroup getAgentGroup(java.lang.String name)
public void addAgentGroup(AgentGroup group)
protected void addStandardAgentGroups()
public void processCommandLineArguments()
For each AgentRelationship, R, R+"s" is treated as a parameter whose value should be a comma-separated list of names.
Simple capabilities can be given by
-external-capabilities=ipcName:verb, ...
AgentRelationship
protected void warnAboutQuestionableAgentNames(java.util.List names, AgentRelationship rel)
public void addContactListener(ContactListener listener)
public void fireNewContact(AgentData data)
public void fireContactDeleted(AgentData data)
public void fireContactChange(AgentData oldData, AgentData newData)
public void fireContactEvent(ContactEvent event)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |