swarm.objectbase
Interface ActivityControl

All Known Implementing Classes:
ActivityControlImpl

public interface ActivityControl
extends SwarmObjectS, SwarmObject

A class that provides an object interface to an activity.. The ActivityControl class specifies an object that can be attached to an activity (regardless of how or where that activity is created) for the purpose of explicitly controlling the execution of actions on that activity's action plan. There is nothing that available through this class that is not already available through the variables or messages available via the activity itself. However, it packages up the main control messages and makes them available to other objects that may need control over an activity, thereby shielding the activity from directly receiving messages from outside objects and saving the user from having to parse the more complex interface to the activity.


Method Summary
 Object attachToActivity(Object anActivity)
          The attachToActivity: method sets an instance variable inside the ActivityControl object that points to the Activity to be controlled.
 Object getStatus()
          The getStatus method returns the status of the activity.
 Object next()
          The next method sends a next message to the activity if the conditions are appropriate.
 Object run()
          The run method sends a run message to the activity if the conditions are appropriate.
 Object step()
          The step method sends a step message to the activity if the conditions are appropriate.
 Object stepUntil(int stopTime)
          The stepUntil: method sends a stepUntil: message to the activity if conditions are appropriate.
 Object stop()
          The stop method sends a stop message to the activity if the conditions are appropriate.
 Object updateStateVar()
          The updateStateVar method updates the ActivityControl instance variables and tests for the continued existence of the activity that is being controlled.
 
Methods inherited from interface swarm.objectbase.SwarmObject
getCompleteProbeMap, getProbeForMessage, getProbeForVariable, getProbeMap
 
Methods inherited from interface swarm.defobj.Drop
drop
 
Methods inherited from interface swarm.defobj.DefinedObject
compare, describe, describeID, getDisplayName, getTypeName, getZone, perform, perform$with, perform$with$with, perform$with$with$with, respondsTo, setDisplayName, xfprint, xfprintid, xprint, xprintid
 

Method Detail

attachToActivity

public Object attachToActivity(Object anActivity)
The attachToActivity: method sets an instance variable inside the ActivityControl object that points to the Activity to be controlled. It then creates a Schedule upon which it places a message to itself to update its own variables.

run

public Object run()
The run method sends a run message to the activity if the conditions are appropriate. This message causes the activity to continue executing the actions on its schedule until either no other actions are waiting, or until the execution of actions is stopped by a subactivity or stopped by a stop message to the activity. If the activity completes executing all the actions on its schedule, the run method returns Completed.

stop

public Object stop()
The stop method sends a stop message to the activity if the conditions are appropriate. This message causes the control to move back up the run-stack and resume at the place in the code where the run was first executed. The next action on the super-activity will begin without finishing the rest of the current activity's actions.

next

public Object next()
The next method sends a next message to the activity if the conditions are appropriate. It runs an activity forward through as many actions as necessary until it hits a breakFunction, at which point it walks back up the tree of activities and returns Stopped. In most cases, this means that an entire action or action group on the activity under control will be executed, including completion of all subactivities.

step

public Object step()
The step method sends a step message to the activity if the conditions are appropriate. It causes the execution of a single action.

stepUntil

public Object stepUntil(int stopTime)
The stepUntil: method sends a stepUntil: message to the activity if conditions are appropriate. This causes all actions on the activity's schedule, including any actions on subactivities' schedules, to be executed until the activity's relative time is equal to stopTime - 1.

updateStateVar

public Object updateStateVar()
The updateStateVar method updates the ActivityControl instance variables and tests for the continued existence of the activity that is being controlled. This message is sent on each cycle of the schedule for the activity being controlled.

getStatus

public Object getStatus()
The getStatus method returns the status of the activity.