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

java.lang.Object
  extended by gov.nasa.arc.brahms.common.rt.BrahmsObjectCtx
      extended by gov.nasa.arc.brahms.common.rt.ConditionCtx
          extended by gov.nasa.arc.brahms.common.rt.DetectableCtx
All Implemented Interfaces:
IBrahmsObjectCtx, IConditionCtx, IDetectableCtx, IRuntimeConstants, java.io.Serializable
Direct Known Subclasses:
VMDetectableCtx

public class DetectableCtx
extends ConditionCtx
implements IDetectableCtx

The DetectableCtx defines the context for a fired detectable defining the detectable that was fired, in what frame or composite activity the detectable was fired, the fact or belief detected and the belief created by the detectable.

Version:
26 September 2000
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
DetectableCtx(Detectable detectable)
          Constructor, creates a new detectable context for the specified detectable.
 
Method Summary
 void addDetectableAction(IDetectableActionCtx action)
          Adds the specified detectable action to the list of detectable actions executed by this detectable.
 java.util.Enumeration getDetectableActions()
          Returns a list of all the detectable actions executed by this detectable.
 IBrahmsObjectCtx getParent()
          Returns the parent context (frame or composite activity) in which this detectable is fired.
 void removeDetectableAction(IDetectableActionCtx action)
          Removes the specified detectable action from the list of detectable actions executed by this detectable.
 void setParent(ICompositeActivityCtx parent)
          Sets the parent composite activity context in which this detectable is fired.
 void setParent(IFrameCtx parent)
          Sets the parent frame context in which this detectable is fired.
 java.lang.String toString()
          Returns the string representation of the detectable context, returning the id and the detectable itself.
 
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.IBrahmsObjectCtx
addNote, getContextFor, getEndTime, getID, getNote, getNotes, getStartTime, removeNote, setEndTime, setID, setStartTime
 

Constructor Detail

DetectableCtx

public DetectableCtx(Detectable detectable)
Constructor, creates a new detectable context for the specified detectable.

Parameters:
detectable - the fired detectable for which this context is the context
Method Detail

setParent

public void setParent(IFrameCtx parent)
               throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Sets the parent frame context in which this detectable is fired.

Specified by:
setParent in interface IDetectableCtx
Parameters:
parent - the FrameCtx in which the detectable is fired
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if a null parent is specified

setParent

public void setParent(ICompositeActivityCtx parent)
               throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Sets the parent composite activity context in which this detectable is fired.

Specified by:
setParent in interface IDetectableCtx
Parameters:
parent - the CompositeActivityCtx in which the detectable is fired
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if a null parent is specified

getParent

public IBrahmsObjectCtx getParent()
                           throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the parent context (frame or composite activity) in which this detectable is fired.

Specified by:
getParent in interface IDetectableCtx
Returns:
IBrahmsObjectCtx the parent context in which the detectable is fired
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if no parent is specified

addDetectableAction

public void addDetectableAction(IDetectableActionCtx action)
                         throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Adds the specified detectable action to the list of detectable actions executed by this detectable.

Specified by:
addDetectableAction in interface IDetectableCtx
Parameters:
action - the IDetectableActionCtx to be added
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if a null action is specified

removeDetectableAction

public void removeDetectableAction(IDetectableActionCtx action)
                            throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Removes the specified detectable action from the list of detectable actions executed by this detectable.

Specified by:
removeDetectableAction in interface IDetectableCtx
Parameters:
action - the IDetectableActionCtx to be removed
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if the specified action is null, or no no actions are specified for the detectable, or the specified action is not found in the list of detectable actions.

getDetectableActions

public java.util.Enumeration getDetectableActions()
                                           throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns a list of all the detectable actions executed by this detectable.

Specified by:
getDetectableActions in interface IDetectableCtx
Returns:
Enumeration a list of IDetectableActionCtx
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if no detectable actions are specified for the detectable.

toString

public java.lang.String toString()
Returns the string representation of the detectable context, returning the id and the detectable itself.

Overrides:
toString in class java.lang.Object
Returns:
String the string representation of the detectable context


Copyright © 1997-2012 All Rights Reserved.