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

java.lang.Object
  extended by gov.nasa.arc.brahms.common.rt.BrahmsObjectCtx
      extended by gov.nasa.arc.brahms.common.rt.ConceptCtx
          extended by gov.nasa.arc.brahms.common.rt.AreaCtx
All Implemented Interfaces:
IAreaCtx, IBrahmsObjectCtx, IConceptCtx, IRuntimeConstants, java.io.Serializable
Direct Known Subclasses:
VMAreaCtx

public class AreaCtx
extends ConceptCtx
implements IAreaCtx

The AreaCtx is the runtime representation of areas defined in a Brahms model. The area context manages the creation and deletion time of the areas. Area contexts are also used to trace the traveled path of an active instance. In the case an area context is used to define a traveled path the start and end time represent the time the active instance arrived in the area and when the active instance left the area. The area context also manages a list of the active instances present in the location.

Version:
8 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
AreaCtx(Area area)
          Constructor, creates a new context for the specified area.
 
Method Summary
 void addInhabitant(ActiveInstanceCtx inhabitant)
          Adds the specified active instance to this location as an inhabitant
 java.util.Enumeration getInhabitants()
          Returns a list of all the inhabitants in this location
 boolean isInhabitant(ActiveInstanceCtx inhabitant)
          Returns whether or not the specified inhabitant is an inhabitant of this area.
 void removeAllInhabitants()
          Removes all inhabitants from this area.
 void removeInhabitant(ActiveInstanceCtx inhabitant)
          Removes the specified active instance from this location as an inhabitant
 
Methods inherited from class gov.nasa.arc.brahms.common.rt.ConceptCtx
addAttribute, addRelation, getAttribute, getRelation, initAttributeRelationCache, removeAttribute, removeRelation, resetAttributeRelationCache, toString
 
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.IBrahmsObjectCtx
addNote, getContextFor, getEndTime, getID, getNote, getNotes, getStartTime, removeNote, setEndTime, setID, setStartTime
 

Constructor Detail

AreaCtx

public AreaCtx(Area area)
Constructor, creates a new context for the specified area.

Parameters:
area - the Area for which to create a context
Method Detail

addInhabitant

public void addInhabitant(ActiveInstanceCtx inhabitant)
                   throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Adds the specified active instance to this location as an inhabitant

Specified by:
addInhabitant in interface IAreaCtx
Parameters:
inhabitant - the active instance to be added
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if a null inhabitant is specified

removeInhabitant

public void removeInhabitant(ActiveInstanceCtx inhabitant)
                      throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Removes the specified active instance from this location as an inhabitant

Specified by:
removeInhabitant in interface IAreaCtx
Parameters:
inhabitant - the active instance to be removed
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if a null inhabitant is specified, if no inhabitants are present in the location or if the inhabitant is not found

isInhabitant

public boolean isInhabitant(ActiveInstanceCtx inhabitant)
Returns whether or not the specified inhabitant is an inhabitant of this area. Returns true if it is, false if not.

Specified by:
isInhabitant in interface IAreaCtx
Parameters:
inhabitant - the inhabitant to be tested
Returns:
boolean true if the specified inhabitant is an inhabitant of this area, false otherwise

getInhabitants

public java.util.Enumeration getInhabitants()
Returns a list of all the inhabitants in this location

Specified by:
getInhabitants in interface IAreaCtx
Returns:
Enumeration an enumeration of ActiveInstanceCtx

removeAllInhabitants

public void removeAllInhabitants()
Removes all inhabitants from this area.

Specified by:
removeAllInhabitants in interface IAreaCtx


Copyright © 1997-2012 All Rights Reserved.