gov.nasa.arc.brahms.vm.rt
Class VMFactCtx

java.lang.Object
  extended by gov.nasa.arc.brahms.common.rt.BrahmsObjectCtx
      extended by gov.nasa.arc.brahms.common.rt.StatementCtx
          extended by gov.nasa.arc.brahms.vm.rt.VMStatementCtx
              extended by gov.nasa.arc.brahms.vm.rt.VMFactCtx
All Implemented Interfaces:
IBrahmsObjectCtx, IFactCtx, IRuntimeConstants, IStatementCtx, gov.nasa.arc.brahms.vm.events.IDiscreteEventData, java.io.Serializable

public class VMFactCtx
extends VMStatementCtx
implements IFactCtx

The VMFactCtx is a FactCtx with extensions for use in the virtual machine. A FactCtx maintains information about a fact created in the world. The fact context defines when the fact is created and what created the fact.

Version:
7 January 2004
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
VMFactCtx(Statement fact)
          Constructor, creates a fact context for the specified fact
VMFactCtx(Statement fact, int sourceType, IBrahmsObjectCtx source)
          Constructor, creates a fact context for the specified fact.
 
Method Summary
 IConceptCtx getCreatedBy()
          Returns the concept responsible for the creation of the fact.
 void setCreatedBy(IConceptCtx concept)
          Sets the concept responsible for the creation of the fact.
 java.lang.String toString()
          Returns the string representation of the fact context, returning the id and 'fact' followed by the fact itself.
 
Methods inherited from class gov.nasa.arc.brahms.vm.rt.VMStatementCtx
getMMEs, handleDiscreteEvent
 
Methods inherited from class gov.nasa.arc.brahms.common.rt.StatementCtx
getSource, getSourceType, setSource, setSourceType
 
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.IStatementCtx
getSource, getSourceType, setSource, setSourceType
 
Methods inherited from interface gov.nasa.arc.brahms.common.rt.IBrahmsObjectCtx
addNote, getContextFor, getEndTime, getID, getNote, getNotes, getStartTime, removeNote, setEndTime, setID, setStartTime
 

Constructor Detail

VMFactCtx

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

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

VMFactCtx

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

Parameters:
fact - the Statement for which this is a context
sourceType - the source type
source - the BrahmsObjectCtx 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

setCreatedBy

public void setCreatedBy(IConceptCtx concept)
                  throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Sets the concept responsible for the creation of the fact. Facts are not owned by any concept but are created by a concept.

Parameters:
concept - the IConceptCtx that created the fact
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if concept is null or an internal error occurs

getCreatedBy

public IConceptCtx getCreatedBy()
                         throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the concept responsible for the creation of the fact.

Returns:
IConceptCtx the concept that created the fact
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if no concept is specified or an internal error occurs

toString

public java.lang.String toString()
Returns the string representation of the fact context, returning the id and 'fact' followed by the fact itself.

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


Copyright © 1997-2012 All Rights Reserved.