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

java.lang.Object
  extended by gov.nasa.arc.brahms.common.rt.BrahmsObjectCtx
      extended by gov.nasa.arc.brahms.common.rt.DetectCtx
All Implemented Interfaces:
IBrahmsObjectCtx, IDetectableActionCtx, IDetectCtx, IRuntimeConstants, java.io.Serializable
Direct Known Subclasses:
VMDetectCtx

public class DetectCtx
extends BrahmsObjectCtx
implements IDetectCtx

The DetectCtx is a detectable action that maintains the information about when the detection took place, what fact was detected and what belief was created as a result of the detection.

Version:
30 June 2000
Author:
Ron van Hoof
See Also:
IDetectCtx, IDetectableCtx, 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
DetectCtx(IDetectableCtx parent)
          Constructor, creates a new context for a detect action for the specified detectable.
 
Method Summary
 void addUsedVariable(IVariableCtx var)
          Adds the specified variable as a variable used by this detectable.
 IBeliefCtx getCreatedBelief()
          Returns the belief created by the detectable in this detect action.
 IFactCtx getDetectedFact()
          Returns the fact detected by the detectable in this detect action.
 IDetectableCtx getParent()
          Returns the detectable context for which this detection was executed.
 java.util.Enumeration getUsedVariables()
          Returns a list of all the variables used by this detectable.
 void removeUsedVariable(IVariableCtx var)
          Removes the specified variable as a variable used by this detectable.
 void setCreatedBelief(IBeliefCtx belief)
          Sets the belief that was created as a result of the fact detection.
 void setDetectedFact(IFactCtx fact)
          Sets the fact that is detected by the detectable in this detect action instance.
 
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, toString, 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

DetectCtx

public DetectCtx(IDetectableCtx parent)
Constructor, creates a new context for a detect action for the specified detectable.

Parameters:
parent - the parent IDetectableCtx
Method Detail

getParent

public IDetectableCtx getParent()
                         throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the detectable context for which this detection was executed.

Specified by:
getParent in interface IDetectableActionCtx
Returns:
IDetectableCtx the parent
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - when no parent is specified

setDetectedFact

public void setDetectedFact(IFactCtx fact)
                     throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Sets the fact that is detected by the detectable in this detect action instance.

Specified by:
setDetectedFact in interface IDetectCtx
Parameters:
fact - the detected fact
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if the specified fact is null

getDetectedFact

public IFactCtx getDetectedFact()
                         throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the fact detected by the detectable in this detect action.

Specified by:
getDetectedFact in interface IDetectCtx
Returns:
IFactCtx the detected fact
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if the detected fact is null

setCreatedBelief

public void setCreatedBelief(IBeliefCtx belief)
                      throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Sets the belief that was created as a result of the fact detection.

Specified by:
setCreatedBelief in interface IDetectCtx
Parameters:
belief - the created belief
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if the specified belief is null

getCreatedBelief

public IBeliefCtx getCreatedBelief()
                            throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the belief created by the detectable in this detect action.

Specified by:
getCreatedBelief in interface IDetectCtx
Returns:
IBeliefCtx the created belief
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if the created belief is null

addUsedVariable

public void addUsedVariable(IVariableCtx var)
                     throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Adds the specified variable as a variable used by this detectable.

Specified by:
addUsedVariable in interface IDetectCtx
Parameters:
var - the variable (IVariableCtx) to be added
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if var is null

removeUsedVariable

public void removeUsedVariable(IVariableCtx var)
                        throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Removes the specified variable as a variable used by this detectable.

Specified by:
removeUsedVariable in interface IDetectCtx
Parameters:
var - the variable (IVariableCtx) to be removed
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if variable is null, no variables are present, or the variable is not found

getUsedVariables

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

Specified by:
getUsedVariables in interface IDetectCtx
Returns:
Enumeration an enumeration of IVariableCtx
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if there are no variables


Copyright © 1997-2012 All Rights Reserved.