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

java.lang.Object
  extended by gov.nasa.arc.brahms.common.rt.BrahmsObjectCtx
      extended by gov.nasa.arc.brahms.common.rt.FrameStateCtx
All Implemented Interfaces:
IBrahmsObjectCtx, IRuntimeConstants, java.io.Serializable
Direct Known Subclasses:
ActiveCtx, AvailableCtx, CompleteCtx, ImpasseCtx, InterruptCtx, UnavailableCtx

public class FrameStateCtx
extends BrahmsObjectCtx

The state of the frames instantiated by the virtual machine is maintained using the FrameStateCtx. A frame is at any point in time in one of the following states, available, unavailable, interrupted, impassed, or completed. The FrameStateCtx maintains information about the state of the frame, when the frame entered the state and when the frame left the state and the reason for entering and/or leaving the state. thoughtframes cannot be interrupted or impassed and can therefor not be in these states. The FrameStateCtx allows for keeping a linked list of the states a frame went through, where the last state in the list is the current state.

Version:
28 July 2000
Author:
Ron van Hoof
See Also:
AvailableCtx, UnavailableCtx, ActiveCtx, Interruptctx, ImpasseCtx, CompleteCtx, 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
FrameStateCtx(IFrameCtx frame)
          Constructor, creates a new FrameStateCtx for the specified frame.
 
Method Summary
 IFrameCtx getFrame()
          Returns the frame for which this state is set
 FrameStateCtx getNextFrameState()
          Returns the next frame state that follows this frame state for the same frame
 FrameStateCtx getPreviousFrameState()
          Returns the previous frame state specifying the previous state of this frame state's frame
 int getState()
          Returns the state identifier
 java.lang.String getStateName()
          Returns the name of the state
 void setFrame(IFrameCtx frame)
          Sets the frame for which this state is set.
 void setNextFrameState(FrameStateCtx frame)
          Sets the next frame state to follow this frame state for the same frame
 void setPreviousFrameState(FrameStateCtx frame)
          Sets the previous frame state specifying the previous state of this frame state's frame
 
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

FrameStateCtx

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

Parameters:
frame - the IFrameCtx for which this state is set
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if frame specified is null
Method Detail

getState

public int getState()
Returns the state identifier

Returns:
int the state id

getStateName

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

Returns:
String the name of the state

setFrame

public void setFrame(IFrameCtx frame)
              throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Sets the frame for which this state is set.

Parameters:
frame - the frame for which this state is set
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if the specified frame is null

getFrame

public IFrameCtx getFrame()
                   throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the frame for which this state is set

Returns:
IFrameCtx the frame for which this state is set
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if no frame is specified

setNextFrameState

public void setNextFrameState(FrameStateCtx frame)
Sets the next frame state to follow this frame state for the same frame

Parameters:
frame - the next FrameStateCtx

getNextFrameState

public FrameStateCtx getNextFrameState()
Returns the next frame state that follows this frame state for the same frame

Returns:
FrameStateCtx the next frame state or null if this is the last or current frame state

setPreviousFrameState

public void setPreviousFrameState(FrameStateCtx frame)
Sets the previous frame state specifying the previous state of this frame state's frame

Parameters:
frame - the previous FrameStateCtx

getPreviousFrameState

public FrameStateCtx getPreviousFrameState()
Returns the previous frame state specifying the previous state of this frame state's frame

Returns:
FrameStateCtx the previous frame state or null if this is the first frame state


Copyright © 1997-2012 All Rights Reserved.