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

java.lang.Object
  extended by gov.nasa.arc.brahms.common.rt.BrahmsObjectCtx
      extended by gov.nasa.arc.brahms.common.rt.StatementCtx
All Implemented Interfaces:
IBrahmsObjectCtx, IRuntimeConstants, IStatementCtx, java.io.Serializable
Direct Known Subclasses:
BeliefCtx, FactCtx, VMStatementCtx

public class StatementCtx
extends BrahmsObjectCtx
implements IStatementCtx

The StatementCtx defines a context for a Statement defining the source of the statement, the element that created the statement. The source of a statement can be a concept due to the definition of initial statements, a consequence, a detectable, a transfer definition, an activity (actually the engine core that generates statements based on the activities executed), or just the engine core (reflection statements).

Version:
4 August 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
StatementCtx(Statement statement)
          Constructor, creates a statement context for the specified statement.
StatementCtx(Statement statement, int sourceType, IBrahmsObjectCtx source)
          Constructor, creates a statement context for the specified statement.
 
Method Summary
 IBrahmsObjectCtx getSource()
          Returns the source of the statement, no source is specified for reflection statements generated by the engine (source type == ENGINE).
 int getSourceType()
          Returns the type of the source of this statement
 void setSource(IBrahmsObjectCtx source)
          Sets the source of the statement, no source is specified for reflection statements generated by the engine (source type == ENGINE).
 void setSourceType(int type)
          Sets the type of the source of this statement
 
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

StatementCtx

public StatementCtx(Statement statement)
             throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Constructor, creates a statement context for the specified statement.

Parameters:
statement - the Statement for which this is a context
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException

StatementCtx

public StatementCtx(Statement statement,
                    int sourceType,
                    IBrahmsObjectCtx source)
             throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Constructor, creates a statement context for the specified statement.

Parameters:
statement - the Statement for which this is a context
sourceType - the source type
source - the IBrahmsObjectCtx causing the creation of the statement
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an invalid source type or source is specified
See Also:
IRuntimeConstants.INITIAL, IRuntimeConstants.CONSEQUENCE, IRuntimeConstants.DETECTABLE, IRuntimeConstants.TRANSFER, IRuntimeConstants.ACTIVITY, IRuntimeConstants.ENGINE
Method Detail

setSourceType

public void setSourceType(int type)
                   throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Sets the type of the source of this statement

Specified by:
setSourceType in interface IStatementCtx
Parameters:
type - the source type
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an invalid source type is specified
See Also:
IRuntimeConstants.INITIAL, IRuntimeConstants.CONSEQUENCE, IRuntimeConstants.DETECTABLE, IRuntimeConstants.TRANSFER, IRuntimeConstants.ACTIVITY, IRuntimeConstants.ENGINE, IRuntimeConstants.EXTERNAL_AGENT, IRuntimeConstants.JAVA_PROPERTY

getSourceType

public int getSourceType()
                  throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the type of the source of this statement

Specified by:
getSourceType in interface IStatementCtx
Returns:
int the source type
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if no source type is specified
See Also:
IRuntimeConstants.INITIAL, IRuntimeConstants.CONSEQUENCE, IRuntimeConstants.DETECTABLE, IRuntimeConstants.TRANSFER, IRuntimeConstants.ACTIVITY, IRuntimeConstants.ENGINE, IRuntimeConstants.EXTERNAL_AGENT, IRuntimeConstants.JAVA_PROPERTY

setSource

public void setSource(IBrahmsObjectCtx source)
               throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Sets the source of the statement, no source is specified for reflection statements generated by the engine (source type == ENGINE). For initial statements (INITIAL) a concept is to be specified (IConceptCtx), for external agents also the IConceptCtx of the external agent is to be specified, for consequence based statements a consequence is to be specified (IConsequenceCtx), for detectable based statements a detectable action is to be specified (IDetectableActionCtx), for transfer definition (TRANSFER) based statements a transfer definition is to be specified (ITransferDefinitionCtx), and for statements generated by the engine as a side effect of an activity, the activity is to be specified (IActivityCtx).

Specified by:
setSource in interface IStatementCtx
Parameters:
source - the IBrahmsObjectCtx causing the creation of the statement
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if a null source is specified

getSource

public IBrahmsObjectCtx getSource()
                           throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the source of the statement, no source is specified for reflection statements generated by the engine (source type == ENGINE).

Specified by:
getSource in interface IStatementCtx
Returns:
IBrahmsObjectCtx the source causing the creation of the statement
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if no source is specified
See Also:
setSource(gov.nasa.arc.brahms.common.rt.IBrahmsObjectCtx)


Copyright © 1997-2012 All Rights Reserved.