gov.nasa.arc.brahms.vm.data
Class VMModel

java.lang.Object
  extended by gov.nasa.arc.brahms.common.data.BrahmsObject
      extended by gov.nasa.arc.brahms.common.data.ModelElement
          extended by gov.nasa.arc.brahms.common.data.NamedModelElement
              extended by gov.nasa.arc.brahms.common.data.Model
                  extended by gov.nasa.arc.brahms.vm.data.VMModel
All Implemented Interfaces:
gov.nasa.arc.brahms.common.IConstants, java.io.Serializable

public class VMModel
extends Model

VMModel is a specialization of Model managing the set of Brahms concepts part of an agent distribution. The VMModel enables the dynamic loading of new concepts when they are not loaded at initialization time.

Version:
$Revision: 1.2 $ $Date: 2008/02/28 19:46:50 $ $Author: rvhoof $
Author:
Ron van Hoof
See Also:
Serialized Form

Field Summary
 
Fields inherited from class gov.nasa.arc.brahms.common.data.Model
AGENTS_PROPERTY, AREADEFS_PROPERTY, AREAS_PROPERTY, CLASSES_PROPERTY, CONCEPTUAL_CLASSES_PROPERTY, CONCEPTUAL_OBJECTS_PROPERTY, GROUPS_PROPERTY, OBJECTS_PROPERTY, PATHS_PROPERTY
 
Fields inherited from class gov.nasa.arc.brahms.common.data.NamedModelElement
NAME_PROPERTY
 
Fields inherited from interface gov.nasa.arc.brahms.common.IConstants
ABORT, ACTIVECLASS, ACTIVECONCEPT, ACTIVEINSTANCE, AGENT, ANONYMOUS, ANYAGENT, AREA, AREADEF, ASSIGNED, ATTRIBUTE, BASEAREADEF, BASECLASS, BASECONCEPTUALCLASS, BASEGROUP, BASELIBRARY, BOOLEAN, BROADCAST, BUILDING, BYTE, CCLOCK, CDATE, CHAR, CITY, CLASS, CLOCK, COLLECTALL, COMMUNICATE, COMPLETE, COMPOSITE, COMPUTER, CONCEPT, CONCEPTUALCLASS, CONCEPTUALCONCEPT, CONCEPTUALOBJECT, CONTINUE, COPY, CREATEAGENT, CREATEAREA, CREATEOBJECT, current, CURRENT, DATAFRAME, DATE, DB, DETECTABLE, DIV, DOUBLE, EMAIL, EMPTY_STRING, END, ENDACTIVITY, ENTAGENT, EQ, EXCEPTION, EXPR, FACE2FACE, FACTFRAME, FALSE, FAX, FLOAT, FOREACH, FORONE, G2, GE, GEOGRAPHYCONCEPT, GESTURE, GET, GROUP, GT, IMPASSE, INT, INVALID, JAVA, JAVA_TYPE, KNOWN_MODIFIER, KNOWNVAL_MODIFIER, LE, LOCAL, LONG, LT, MAP, MINUS, MOD, MOVE, MULT, NE, NEW, NONE, NOT_MODIFIER, NOWORK, O, OA, OBJECT, ONTOLOGY, PAGER, PARAMETER, PATH, PHONE, PLUS, PRIMITIVE, PRIVATE, PROAGENT, PROTECTED, PRSAGENT, PUBLIC, PUT, RECEIVE, RELATION, sACTIVECLASS, sACTIVECONCEPT, sACTIVEINSTANCE, sAGENT, sARCHIVE, sAREA, sAREADEF, sBOOLEAN, sBYTE, sBYTECODEEXT, sCHAR, sCLASS, sCOMPUTER, sCONCEPT, sCONCEPTUALCLASS, sCONCEPTUALCONCEPT, sCONCEPTUALOBJECT, sCOPY, sCURRENT, sDETECTABLE, sDOUBLE, sEMAIL, sEND, SEND, sFACE2FACE, sFAX, sFILEEXT, sFLOAT, sGEOGRAPHYCONCEPT, sGROUP, SHORT, SIMAGENT, sINT, sJAVA_TYPE, sLONG, sMAP, sNEW, sNONE, sNOWORK, sOBJECT, SOURCECODE, sPAGER, sPARAMETER, sPATH, sPHONE, sPRIVATE, sPROJECTEXT, sPROTECTED, sPUBLIC, sSHORT, sSTART, sSTRING, sSYMBOL, START, STRING, sUNKNOWN, sVOID, SYMBOL, TRUE, UDT, UML, UNASSIGNED, UNDEFINED, unknown, UNKNOWN, UNKNOWN_MODIFIER, V, VARIABLE, VOID, WHENEVER, WORKFRAME, WORLD, XML
 
Constructor Summary
VMModel()
          Constructor, creates a new empty model with no name.
VMModel(java.lang.String name)
          Constructor, creates a new empty model with the specified name.
 
Method Summary
 Agent getAgent(java.lang.String name)
           
 Agent getAgent(java.lang.String name, int strategy)
          Returns the agent with the specified name.
 Area getArea(java.lang.String name)
           
 Area getArea(java.lang.String name, int strategy)
          Returns the area with the specified name.
 AreaDef getAreaDef(java.lang.String name)
           
 ObjectClass getClass(java.lang.String name)
           
 Concept getConcept(java.lang.String name)
          Returns the concept with the specified name.
 Concept getConcept(java.lang.String name, boolean load)
          Returns the concept with the specified name.
 Concept getConcept(java.lang.String name, boolean load, boolean type)
          Returns the concept with the specified name.
 Concept getConcept(java.lang.String name, int strategy)
          Returns the concept with the specified name.
 Concept getConceptClass(java.lang.String name)
           
 ConceptualClass getConceptualClass(java.lang.String name)
           
 ConceptualInstance getConceptualObject(java.lang.String name)
           
 ConceptualInstance getConceptualObject(java.lang.String name, int strategy)
          Returns the conceptual object with the specified name.
 Group getGroup(java.lang.String name)
           
 ObjectInstance getObject(java.lang.String name)
           
 ObjectInstance getObject(java.lang.String name, int strategy)
          Returns the object with the specified name.
 Path getPath(java.lang.String name)
           
 Path getPath(java.lang.String name, int strategy)
          Returns the path with the specified name.
 
Methods inherited from class gov.nasa.arc.brahms.common.data.Model
addAgent, addArea, addAreaDef, addClass, addConcept, addConceptualClass, addConceptualObject, addGroup, addObject, addPath, export, export, getAgents, getAreaDefs, getAreas, getClasses, getConcepts, getConceptualClasses, getConceptualObjects, getFullyQualifiedName, getGroups, getObjects, getPackage, getPaths, removeAgent, removeArea, removeAreaDef, removeClass, removeConceptualClass, removeConceptualObject, removeGroup, removeObject, removePath, setPackage
 
Methods inherited from class gov.nasa.arc.brahms.common.data.NamedModelElement
getDisplayText, getName, getOwner, setDisplayText, setFullyQualifiedName, setName, setOwner, toString
 
Methods inherited from class gov.nasa.arc.brahms.common.data.BrahmsObject
delete, export, getFile, getID, getLine, getSerialNumber, isBCC, isDynamic, isLoaded, isResolved, setBCC, setDynamic, setFile, setID, setID, setLine, setLoaded, setResolved, setSerialNumber
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VMModel

public VMModel()
Constructor, creates a new empty model with no name.


VMModel

public VMModel(java.lang.String name)
Constructor, creates a new empty model with the specified name.

Parameters:
name - the name of the model.
Method Detail

getGroup

public Group getGroup(java.lang.String name)
               throws java.util.NoSuchElementException
Overrides:
getGroup in class Model
Throws:
java.util.NoSuchElementException

getAgent

public Agent getAgent(java.lang.String name)
               throws java.util.NoSuchElementException
Overrides:
getAgent in class Model
Throws:
java.util.NoSuchElementException

getAgent

public Agent getAgent(java.lang.String name,
                      int strategy)
               throws java.util.NoSuchElementException
Returns the agent with the specified name. The name has to be the fully qualified name of the agent. A fully qualified name consists of the package name and the agent name. For example: gov.nasa.arc.brahms.MyAgent. The package name in this example is 'gov.nasa.arc.brahms', the agent name is 'MyAgent', both have to be concatenated using a '.'.

The locating and loading strategy gives control over how to locate and load an agent if it cannot be found. Only when the loading strategy is exhausted will an exception be generated to indicate that an agent with the specified name could not be found.

Parameters:
name - the fully qualified name of the agent.
strategy - the locating and loading strategy to use
Returns:
Agent the agent with the specified fully qualified name
Throws:
java.util.NoSuchElementException - if no agent with the specified name could be found
See Also:
IModel.MEMORY, IModel.MEMORY_DISK, IModel.MEMORY_DIRECTORY, IModel.MEMORY_DIRECTORY_DISK, IModel.MEMORY_DISK_DIRECTORY

getClass

public ObjectClass getClass(java.lang.String name)
                     throws java.util.NoSuchElementException
Overrides:
getClass in class Model
Throws:
java.util.NoSuchElementException

getObject

public ObjectInstance getObject(java.lang.String name)
                         throws java.util.NoSuchElementException
Overrides:
getObject in class Model
Throws:
java.util.NoSuchElementException

getObject

public ObjectInstance getObject(java.lang.String name,
                                int strategy)
                         throws java.util.NoSuchElementException
Returns the object with the specified name. The name has to be the fully qualified name of the object. A fully qualified name consists of the package name and the object name. For example: gov.nasa.arc.brahms.MyObject. The package name in this example is 'gov.nasa.arc.brahms', the object name is 'MyObject', both have to be concatenated using a '.'.

The locating and loading strategy gives control over how to locate and load an object if it cannot be found. Only when the loading strategy is exhausted will an exception be generated to indicate that an object with the specified name could not be found.

Parameters:
name - the fully qualified name of the object.
strategy - the locating and loading strategy to use
Returns:
ObjectInstance the object with the specified fully qualified name
Throws:
java.util.NoSuchElementException - if no object with the specified name could be found
See Also:
IModel.MEMORY, IModel.MEMORY_DISK, IModel.MEMORY_DIRECTORY, IModel.MEMORY_DIRECTORY_DISK, IModel.MEMORY_DISK_DIRECTORY

getConceptualClass

public ConceptualClass getConceptualClass(java.lang.String name)
                                   throws java.util.NoSuchElementException
Overrides:
getConceptualClass in class Model
Throws:
java.util.NoSuchElementException

getConceptualObject

public ConceptualInstance getConceptualObject(java.lang.String name)
                                       throws java.util.NoSuchElementException
Overrides:
getConceptualObject in class Model
Throws:
java.util.NoSuchElementException

getConceptualObject

public ConceptualInstance getConceptualObject(java.lang.String name,
                                              int strategy)
                                       throws java.util.NoSuchElementException
Returns the conceptual object with the specified name. The name has to be the fully qualified name of the conceptual object. A fully qualified name consists of the package name and the conceptual object name. For example: gov.nasa.arc.brahms.MyConceptualObject. The package name in this example is 'gov.nasa.arc.brahms', the object name is 'MyConceptualObject', both have to be concatenated using a '.'.

The locating and loading strategy gives control over how to locate and load an conceptual object if it cannot be found. Only when the loading strategy is exhausted will an exception be generated to indicate that a conceptual object with the specified name could not be found.

Parameters:
name - the fully qualified name of the conceptual object.
strategy - the locating and loading strategy to use
Returns:
ConceptualInstance the conceptual object with the specified fully qualified name
Throws:
java.util.NoSuchElementException - if no conceptual object with the specified name could be found
See Also:
IModel.MEMORY, IModel.MEMORY_DISK, IModel.MEMORY_DIRECTORY, IModel.MEMORY_DIRECTORY_DISK, IModel.MEMORY_DISK_DIRECTORY

getAreaDef

public AreaDef getAreaDef(java.lang.String name)
                   throws java.util.NoSuchElementException
Overrides:
getAreaDef in class Model
Throws:
java.util.NoSuchElementException

getArea

public Area getArea(java.lang.String name)
             throws java.util.NoSuchElementException
Overrides:
getArea in class Model
Throws:
java.util.NoSuchElementException

getArea

public Area getArea(java.lang.String name,
                    int strategy)
             throws java.util.NoSuchElementException
Returns the area with the specified name. The name has to be the fully qualified name of the area. A fully qualified name consists of the package name and the area name. For example: gov.nasa.arc.brahms.MyArea. The package name in this example is 'gov.nasa.arc.brahms', the area name is 'MyArea', both have to be concatenated using a '.'.

The locating and loading strategy gives control over how to locate and load an area if it cannot be found. Only when the loading strategy is exhausted will an exception be generated to indicate that an area with the specified name could not be found.

Parameters:
name - the fully qualified name of the area.
strategy - the locating and loading strategy to use
Returns:
Area the area with the specified fully qualified name
Throws:
java.util.NoSuchElementException - if no area with the specified name could be found
See Also:
IModel.MEMORY, IModel.MEMORY_DISK, IModel.MEMORY_DIRECTORY, IModel.MEMORY_DIRECTORY_DISK, IModel.MEMORY_DISK_DIRECTORY

getPath

public Path getPath(java.lang.String name)
             throws java.util.NoSuchElementException
Overrides:
getPath in class Model
Throws:
java.util.NoSuchElementException

getPath

public Path getPath(java.lang.String name,
                    int strategy)
             throws java.util.NoSuchElementException
Returns the path with the specified name. The name has to be the fully qualified name of the path. A fully qualified name consists of the package name and the path name. For example: gov.nasa.arc.brahms.MyPath. The package name in this example is 'gov.nasa.arc.brahms', the path name is 'MyPath', both have to be concatenated using a '.'.

The locating and loading strategy gives control over how to locate and load a path if it cannot be found. Only when the loading strategy is exhausted will an exception be generated to indicate that a path with the specified name could not be found.

Parameters:
name - the fully qualified name of the path.
strategy - the locating and loading strategy to use
Returns:
Path the path with the specified fully qualified name
Throws:
java.util.NoSuchElementException - if no path with the specified name could be found
See Also:
IModel.MEMORY, IModel.MEMORY_DISK, IModel.MEMORY_DIRECTORY, IModel.MEMORY_DIRECTORY_DISK, IModel.MEMORY_DISK_DIRECTORY

getConcept

public Concept getConcept(java.lang.String name)
                   throws java.util.NoSuchElementException
Description copied from class: Model
Returns the concept with the specified name.

Note: this method should only be used if the type of the concept is not relevant.

Overrides:
getConcept in class Model
Parameters:
name - the name of the requested concept
Returns:
Concept the requested concept
Throws:
java.util.NoSuchElementException - if a concept with the specified name does not exist

getConcept

public Concept getConcept(java.lang.String name,
                          int strategy)
                   throws java.util.NoSuchElementException
Returns the concept with the specified name. The name has to be the fully qualified name of the concept. A fully qualified name consists of the package name and the concept name. For example: gov.nasa.arc.brahms.MyAgent. The package name in this example is 'gov.nasa.arc.brahms', the concept name is 'MyAgent', both have to be concatenated using a '.'.

The locating and loading strategy gives control over how to locate and load an concept if it cannot be found. Only when the loading strategy is exhausted will an exception be generated to indicate that a concept with the specified name could not be found.

Parameters:
name - the fully qualified name of the concept.
strategy - the locating and loading strategy to use
Returns:
Concept the concept with the specified fully qualified name
Throws:
java.util.NoSuchElementException - if no concept with the specified name could be found
See Also:
IModel.MEMORY, IModel.MEMORY_DISK, IModel.MEMORY_DIRECTORY, IModel.MEMORY_DIRECTORY_DISK, IModel.MEMORY_DISK_DIRECTORY

getConceptClass

public Concept getConceptClass(java.lang.String name)
                        throws java.util.NoSuchElementException
Throws:
java.util.NoSuchElementException

getConcept

public Concept getConcept(java.lang.String name,
                          boolean load)
                   throws java.util.NoSuchElementException
Returns the concept with the specified name. If it does not exist and load is true it will try to find and load it, if load is false it will throw a NoSuchElementException.

Parameters:
name - the fully qualified name of the concept to be returned
load - true if the concept is to be loaded if not found, false if not to be loaded
Returns:
Concept the requested concept
Throws:
java.util.NoSuchElementException - if no element by the specified was found or could be loaded

getConcept

public Concept getConcept(java.lang.String name,
                          boolean load,
                          boolean type)
                   throws java.util.NoSuchElementException
Returns the concept with the specified name. If it does not exist and load is true it will try to find and load it, if load is false it will throw a NoSuchElementException. If type is true it indicates that the name for the concept is a class type concept and does not need remote lookup, only local, if type is false the name of the concept is for an instance and remote lookup should be considered.

Parameters:
name - the fully qualified name of the concept to be returned
load - true if the concept is to be loaded if not found, false if not to be loaded
type - true if the name of the concept is for a class/group/areadef, false if for an instance (agent/object/area/path)
Returns:
Concept the requested concept
Throws:
java.util.NoSuchElementException - if no element by the specified was found or could be loaded


Copyright © 1997-2012 All Rights Reserved.