|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectse.liu.ida.critiquer.activities.parameters.Commander
public class Commander
A commander has a list of activities for which this commander is responsible. Whenever choices are made in the CommanderParameter, Commander objects are notified that they should update their information on which activities they are responsible for. Agents are added to commanding activities, but commanders may choose not to use agents for specific tasks. Therefore it is possible to remove agents on a per-activity basis. To enable a more fine-grained control over which activities are associated with which agents, agents can be removed from individual sub-activities that this commander controls,
Constructor Summary | |
---|---|
Commander(String name)
|
Method Summary | |
---|---|
void |
addActivity(Activity a)
Add an activity directly controlled by this commander |
void |
addActivityToAgentMappings(Activity a)
|
void |
addMapping(Activity activity,
Agent agent)
|
void |
agentAdded(Agent a)
|
void |
agentRemoved(Activity activity,
Agent agent)
|
ArrayList<Activity> |
getActivities()
get the activities that have this commander as the value of their CommanderParameter. |
ArrayList<Activity> |
getActivitiesFrom(Activity rootActivity)
Recurse through the activity tree starting at rootActivity and return a list of all activities. |
AgentParameter |
getAgentParameter()
|
HashSet<Agent> |
getAgentsInActivity(Activity activity)
|
ArrayList<Activity> |
getAllActivities()
Recurse through the activity forest and return a list of all activities. |
String |
getName()
|
HashSet<Agent> |
getSubordinates()
|
void |
notifyActivities()
There is no special updating to do other than related to time We must remember to update the dependent activities as well however |
void |
removeActivity(Activity a)
Used when an activity that had this commander get a different one (or none at all) |
void |
removeActivityFromAgentMappings(Activity a)
Used when an activity is no longer among the indirectly controlled activities under this commander. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Commander(String name)
Method Detail |
---|
public void agentAdded(Agent a)
public void addMapping(Activity activity, Agent agent)
public HashSet<Agent> getAgentsInActivity(Activity activity)
public void agentRemoved(Activity activity, Agent agent)
public void addActivity(Activity a)
a
- public void addActivityToAgentMappings(Activity a)
public void removeActivity(Activity a)
a
- public void removeActivityFromAgentMappings(Activity a)
a
- The activity which has changed inheritance.public String toString()
toString
in class Object
public String getName()
public HashSet<Agent> getSubordinates()
public AgentParameter getAgentParameter()
public ArrayList<Activity> getActivities()
public ArrayList<Activity> getAllActivities()
public ArrayList<Activity> getActivitiesFrom(Activity rootActivity)
public void notifyActivities()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |