gov.nasa.arc.brahms.common.rt
Class ContainmentActivityCtx

java.lang.Object
  extended by gov.nasa.arc.brahms.common.rt.BrahmsObjectCtx
      extended by gov.nasa.arc.brahms.common.rt.ActivityCtx
          extended by gov.nasa.arc.brahms.common.rt.PrimitiveActivityCtx
              extended by gov.nasa.arc.brahms.common.rt.ContainmentActivityCtx
All Implemented Interfaces:
IActivityCtx, IBrahmsObjectCtx, IContainmentActivityCtx, IPrimitiveActivityCtx, IRuntimeConstants, java.io.Serializable
Direct Known Subclasses:
GetActivityCtx, PutActivityCtx

public abstract class ContainmentActivityCtx
extends PrimitiveActivityCtx
implements IContainmentActivityCtx

The ContainmentActivityCtx is the generic class for the GetActivityCtx and PutActivityCtx.

Version:
29 May 2001
Author:
Ron van Hoof
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface gov.nasa.arc.brahms.common.rt.IRuntimeConstants
ABORTED, ACTIVE, ACTIVITY, AVAILABLE, COMPLETED, CONSEQUENCE, DETECTABLE, ENDED, ENGINE, EXTERNAL_AGENT, FROM, IMPASSED, INITIAL, INTERRUPTED, JAVA_PROPERTY, sABORTED, sACTIVE, sAVAILABLE, sCOMPLETED, sENDED, sIMPASSED, sINTERRUPTED, sUNAVAILABLE, TO, TRANSFER, UNAVAILABLE
 
Constructor Summary
ContainmentActivityCtx(ContainmentActivity act)
          Constructor, creates a new context for the specified ContainmentActivity.
 
Method Summary
 void addItem(ParameterCtx item)
          Adds the specified item as an item picked up or dropped off through this activity.
 int getItemCount()
          Return the number of items associated with the activity.
 java.util.Enumeration getItems()
          Returns a list of all the items (ParameterCtx).
 ParameterCtx getWhen()
          Returns when the activity action is to take place (start or end).
 void removeItem(ParameterCtx item)
          Removes the specified item as an item picked up or dropped off through this activity.
 void setWhen(ParameterCtx when)
          Sets when the activity action is to take place (start or end).
 
Methods inherited from class gov.nasa.arc.brahms.common.rt.PrimitiveActivityCtx
addResource, getDuration, getElapsedTime, getMaxDuration, getMinDuration, getRandom, getResourceCount, getResources, removeResource, setDuration, setElapsedTime, setMaxDuration, setMinDuration, setRandom
 
Methods inherited from class gov.nasa.arc.brahms.common.rt.ActivityCtx
getCompletionCause, getDisplayText, getParentFrame, getPerformedBy, getPriority, getReferencedBy, getState, getStatus, setCompletionCause, setDisplayText, setParentFrame, setPerformedBy, setPriority, setReferencedBy, setState, setState, setStatus, toString
 
Methods inherited from class gov.nasa.arc.brahms.common.rt.BrahmsObjectCtx
addNote, getContextFor, getEndTime, getID, getNote, getNotes, getStartTime, removeNote, setContextFor, setEndTime, setID, setStartTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface gov.nasa.arc.brahms.common.rt.IPrimitiveActivityCtx
addResource, getDuration, getElapsedTime, getMaxDuration, getMinDuration, getRandom, getResourceCount, getResources, removeResource, setElapsedTime
 
Methods inherited from interface gov.nasa.arc.brahms.common.rt.IActivityCtx
getCompletionCause, getDisplayText, getParentFrame, getPerformedBy, getPriority, getReferencedBy, getStatus, setCompletionCause, setDisplayText, setParentFrame, setPerformedBy, setReferencedBy, setStatus
 
Methods inherited from interface gov.nasa.arc.brahms.common.rt.IBrahmsObjectCtx
addNote, getContextFor, getEndTime, getID, getNote, getNotes, getStartTime, removeNote, setEndTime, setID, setStartTime
 

Constructor Detail

ContainmentActivityCtx

public ContainmentActivityCtx(ContainmentActivity act)
Constructor, creates a new context for the specified ContainmentActivity.

Parameters:
act - the ContainmentActivity for which to create a context
Method Detail

addItem

public void addItem(ParameterCtx item)
             throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Adds the specified item as an item picked up or dropped off through this activity. The actual item is the agent or object referenced by the parameter context where the parameter context specifies when the item was associated with the activity.

Specified by:
addItem in interface IContainmentActivityCtx
Parameters:
item - the item (ParameterCtx) to be added
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if item is null

removeItem

public void removeItem(ParameterCtx item)
                throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Removes the specified item as an item picked up or dropped off through this activity. The actual item is the agent or object referenced by the parameter context where the parameter context specifies when the item was (dis)associated with the activity.

Specified by:
removeItem in interface IContainmentActivityCtx
Parameters:
item - the item (ParameterCtx) to be removed
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if item is null, no items are available, or the item is not found

getItems

public java.util.Enumeration getItems()
                               throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns a list of all the items (ParameterCtx).

Specified by:
getItems in interface IContainmentActivityCtx
Returns:
Enumeration an enumeration of ParameterCtx
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if there are no items

getItemCount

public int getItemCount()
Return the number of items associated with the activity.

Specified by:
getItemCount in interface IContainmentActivityCtx
Returns:
int the number of items

setWhen

public void setWhen(ParameterCtx when)
             throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Sets when the activity action is to take place (start or end). The when value is set through a parameter context containing either the actual value or a reference to a variable containing the when value.

Parameters:
when - the ParameterCtx defining when the activity action is to be executed
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if a null when value is defined

getWhen

public ParameterCtx getWhen()
                     throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns when the activity action is to take place (start or end). The when value is set through a parameter context containing either the actual value or a reference to a variable containing the when value.

Specified by:
getWhen in interface IContainmentActivityCtx
Returns:
ParameterCtx the when value defining when the action is to occur
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if the when value is not defined


Copyright © 1997-2012 All Rights Reserved.