gov.nasa.arc.brahms.common.data
Class Model

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
All Implemented Interfaces:
gov.nasa.arc.brahms.common.IConstants, java.io.Serializable
Direct Known Subclasses:
VMModel

public class Model
extends NamedModelElement

class Model

Version:
24 June 2004
Author:
Ron van Hoof
See Also:
Serialized Form

Field Summary
static java.lang.String AGENTS_PROPERTY
           
static java.lang.String AREADEFS_PROPERTY
           
static java.lang.String AREAS_PROPERTY
           
static java.lang.String CLASSES_PROPERTY
           
static java.lang.String CONCEPTUAL_CLASSES_PROPERTY
           
static java.lang.String CONCEPTUAL_OBJECTS_PROPERTY
           
static java.lang.String GROUPS_PROPERTY
           
static java.lang.String OBJECTS_PROPERTY
           
static java.lang.String 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
Model()
           
Model(java.lang.String name)
           
 
Method Summary
 boolean addAgent(Agent concept)
           
 boolean addArea(Area concept)
           
 boolean addAreaDef(AreaDef concept)
           
 boolean addClass(ObjectClass concept)
           
 boolean addConcept(Concept concept)
          Adds a concept to the model.
 boolean addConceptualClass(ConceptualClass concept)
           
 boolean addConceptualObject(ConceptualInstance concept)
           
 boolean addGroup(Group concept)
           
 boolean addObject(ObjectInstance concept)
           
 boolean addPath(Path concept)
           
 void export(java.lang.String fileName, int destination, gov.nasa.arc.brahms.util.IErrorLog log)
          Allows for the model to be exported into different formats.
 void export(java.lang.String basedir, int destination, gov.nasa.arc.brahms.util.IErrorLog log, java.util.Properties p)
          Allows for the model to be exported into different formats.
 Agent getAgent(java.lang.String name)
           
 java.util.Enumeration getAgents()
           
 Area getArea(java.lang.String name)
           
 AreaDef getAreaDef(java.lang.String name)
           
 java.util.Enumeration getAreaDefs()
           
 java.util.Enumeration getAreas()
           
 ObjectClass getClass(java.lang.String name)
           
 java.util.Enumeration getClasses()
           
 Concept getConcept(java.lang.String name)
          Returns the concept with the specified name.
 java.util.Enumeration getConcepts()
          Returns all the concepts loaded in the model
 ConceptualClass getConceptualClass(java.lang.String name)
           
 java.util.Enumeration getConceptualClasses()
           
 ConceptualInstance getConceptualObject(java.lang.String name)
           
 java.util.Enumeration getConceptualObjects()
           
 java.lang.String getFullyQualifiedName()
          Returns the fully qualified name of the model.
 Group getGroup(java.lang.String name)
           
 java.util.Enumeration getGroups()
           
 ObjectInstance getObject(java.lang.String name)
           
 java.util.Enumeration getObjects()
           
 java.lang.String getPackage()
          Returns the package in which this concept is defined in and belongs to.
 Path getPath(java.lang.String name)
           
 java.util.Enumeration getPaths()
           
 boolean removeAgent(java.lang.String name)
           
 boolean removeArea(java.lang.String name)
           
 boolean removeAreaDef(java.lang.String name)
           
 boolean removeClass(java.lang.String name)
           
 boolean removeConceptualClass(java.lang.String name)
           
 boolean removeConceptualObject(java.lang.String name)
           
 boolean removeGroup(java.lang.String name)
           
 boolean removeObject(java.lang.String name)
           
 boolean removePath(java.lang.String name)
           
 void setPackage(java.lang.String sPackage)
          Sets the package in which this concept is defined in and belongs to.
 
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
 

Field Detail

GROUPS_PROPERTY

public static final java.lang.String GROUPS_PROPERTY
See Also:
Constant Field Values

AGENTS_PROPERTY

public static final java.lang.String AGENTS_PROPERTY
See Also:
Constant Field Values

CLASSES_PROPERTY

public static final java.lang.String CLASSES_PROPERTY
See Also:
Constant Field Values

OBJECTS_PROPERTY

public static final java.lang.String OBJECTS_PROPERTY
See Also:
Constant Field Values

CONCEPTUAL_CLASSES_PROPERTY

public static final java.lang.String CONCEPTUAL_CLASSES_PROPERTY
See Also:
Constant Field Values

CONCEPTUAL_OBJECTS_PROPERTY

public static final java.lang.String CONCEPTUAL_OBJECTS_PROPERTY
See Also:
Constant Field Values

AREADEFS_PROPERTY

public static final java.lang.String AREADEFS_PROPERTY
See Also:
Constant Field Values

AREAS_PROPERTY

public static final java.lang.String AREAS_PROPERTY
See Also:
Constant Field Values

PATHS_PROPERTY

public static final java.lang.String PATHS_PROPERTY
See Also:
Constant Field Values
Constructor Detail

Model

public Model()

Model

public Model(java.lang.String name)
Method Detail

setPackage

public void setPackage(java.lang.String sPackage)
Sets the package in which this concept is defined in and belongs to.

Parameters:
sPackage - the package statement

getPackage

public java.lang.String getPackage()
Returns the package in which this concept is defined in and belongs to.

Returns:
String the concept's package

getFullyQualifiedName

public java.lang.String getFullyQualifiedName()
Returns the fully qualified name of the model. The fully qualified name of a model is the package name of the model followed by the name of the model.

Overrides:
getFullyQualifiedName in class NamedModelElement
Returns:
String the fully qualified name

addGroup

public boolean addGroup(Group concept)

removeGroup

public boolean removeGroup(java.lang.String name)

getGroup

public Group getGroup(java.lang.String name)
               throws java.util.NoSuchElementException
Throws:
java.util.NoSuchElementException

getGroups

public java.util.Enumeration getGroups()

addAgent

public boolean addAgent(Agent concept)

removeAgent

public boolean removeAgent(java.lang.String name)

getAgent

public Agent getAgent(java.lang.String name)
               throws java.util.NoSuchElementException
Throws:
java.util.NoSuchElementException

getAgents

public java.util.Enumeration getAgents()

addClass

public boolean addClass(ObjectClass concept)

removeClass

public boolean removeClass(java.lang.String name)

getClass

public ObjectClass getClass(java.lang.String name)
                     throws java.util.NoSuchElementException
Throws:
java.util.NoSuchElementException

getClasses

public java.util.Enumeration getClasses()

addObject

public boolean addObject(ObjectInstance concept)

removeObject

public boolean removeObject(java.lang.String name)

getObject

public ObjectInstance getObject(java.lang.String name)
                         throws java.util.NoSuchElementException
Throws:
java.util.NoSuchElementException

getObjects

public java.util.Enumeration getObjects()

addConceptualClass

public boolean addConceptualClass(ConceptualClass concept)

removeConceptualClass

public boolean removeConceptualClass(java.lang.String name)

getConceptualClass

public ConceptualClass getConceptualClass(java.lang.String name)
                                   throws java.util.NoSuchElementException
Throws:
java.util.NoSuchElementException

getConceptualClasses

public java.util.Enumeration getConceptualClasses()

addConceptualObject

public boolean addConceptualObject(ConceptualInstance concept)

removeConceptualObject

public boolean removeConceptualObject(java.lang.String name)

getConceptualObject

public ConceptualInstance getConceptualObject(java.lang.String name)
                                       throws java.util.NoSuchElementException
Throws:
java.util.NoSuchElementException

getConceptualObjects

public java.util.Enumeration getConceptualObjects()

addAreaDef

public boolean addAreaDef(AreaDef concept)

removeAreaDef

public boolean removeAreaDef(java.lang.String name)

getAreaDef

public AreaDef getAreaDef(java.lang.String name)
                   throws java.util.NoSuchElementException
Throws:
java.util.NoSuchElementException

getAreaDefs

public java.util.Enumeration getAreaDefs()

addArea

public boolean addArea(Area concept)

removeArea

public boolean removeArea(java.lang.String name)

getArea

public Area getArea(java.lang.String name)
             throws java.util.NoSuchElementException
Throws:
java.util.NoSuchElementException

getAreas

public java.util.Enumeration getAreas()

addPath

public boolean addPath(Path concept)

removePath

public boolean removePath(java.lang.String name)

getPath

public Path getPath(java.lang.String name)
             throws java.util.NoSuchElementException
Throws:
java.util.NoSuchElementException

getPaths

public java.util.Enumeration getPaths()

addConcept

public boolean addConcept(Concept concept)
Adds a concept to the model.

Note: this method should only be used if the type of the concept is not immediately known

Parameters:
concept - the Concept to be added
Returns:
true if the concept is successfully added, false otherwise

getConcept

public Concept getConcept(java.lang.String name)
                   throws java.util.NoSuchElementException
Returns the concept with the specified name.

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

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

getConcepts

public java.util.Enumeration getConcepts()
Returns all the concepts loaded in the model

Returns:
Enumeration an enumeration of all the Concepts in the model

export

public void export(java.lang.String fileName,
                   int destination,
                   gov.nasa.arc.brahms.util.IErrorLog log)
Allows for the model to be exported into different formats. The currently supported exports are to: Source code XML

Parameters:
fileName - the name of the file to export the results to
destination - the type of export
log - the log to write errors to

export

public void export(java.lang.String basedir,
                   int destination,
                   gov.nasa.arc.brahms.util.IErrorLog log,
                   java.util.Properties p)
Allows for the model to be exported into different formats. The currently supported exports are to: Source code XML

Parameters:
dir - the base directory where to export the files to
destination - the type of export
log - the log to write errors to
p - properties for use by the type of export


Copyright © 1997-2012 All Rights Reserved.