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

java.lang.Object
  extended by gov.nasa.arc.brahms.common.rt.BrahmsObjectCtx
      extended by gov.nasa.arc.brahms.common.rt.FrameStateCtx
          extended by gov.nasa.arc.brahms.common.rt.AvailableCtx
All Implemented Interfaces:
IBrahmsObjectCtx, IRuntimeConstants, java.io.Serializable

public class AvailableCtx
extends FrameStateCtx

The AvailableCtx manages information about the available state of a frame. The available state is entered by a frame when its preconditions evaluate to true. This context maintains when the frame enters the available state and when the frame leaves the available state. This context also defines the contexts of the preconditions that evaluated to true, defining the beliefs or facts that caused the precondition to evaluate to true.

Version:
28 July 2000
Author:
Ron van Hoof
See Also:
FrameStateCtx, 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
AvailableCtx(IFrameCtx frame)
          Constructor, creates a new AvailableCtx for the specified frame
 
Method Summary
 void addPrecondition(PreconditionCtx precondition)
          Adds the specified precondition context as one of the preconditions making a frame available.
 java.util.Enumeration getPreconditions()
          Returns all the preconditions that allowed for the frame state to be set to available.
 int getState()
          Returns the state identifier
 java.lang.String getStateName()
          Returns the name of the state
 void removePrecondition(PreconditionCtx precondition)
          Removes the specified precondition context as one of the preconditions making a frame available.
 
Methods inherited from class gov.nasa.arc.brahms.common.rt.FrameStateCtx
getFrame, getNextFrameState, getPreviousFrameState, setFrame, setNextFrameState, setPreviousFrameState
 
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
 

Constructor Detail

AvailableCtx

public AvailableCtx(IFrameCtx frame)
             throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Constructor, creates a new AvailableCtx for the specified frame

Parameters:
frame - the IFrameCtx that is set to available
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if frame specified is null
Method Detail

getState

public int getState()
Returns the state identifier

Overrides:
getState in class FrameStateCtx
Returns:
int the state id

getStateName

public java.lang.String getStateName()
Returns the name of the state

Overrides:
getStateName in class FrameStateCtx
Returns:
String the name of the state

addPrecondition

public void addPrecondition(PreconditionCtx precondition)
                     throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Adds the specified precondition context as one of the preconditions making a frame available.

Parameters:
precondition - the PreconditionCtx to be added
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if precondition is null

removePrecondition

public void removePrecondition(PreconditionCtx precondition)
                        throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Removes the specified precondition context as one of the preconditions making a frame available.

Parameters:
precondition - the PreconditionCtx to be removed
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if precondition is null, no preconditions are specified or if precondition is not found

getPreconditions

public java.util.Enumeration getPreconditions()
                                       throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns all the preconditions that allowed for the frame state to be set to available.

Returns:
Enumeration an enumeration of PreconditionCtx
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if no preconditions are specified.


Copyright © 1997-2012 All Rights Reserved.