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

java.lang.Object
  extended by gov.nasa.arc.brahms.common.data.BrahmsObject
All Implemented Interfaces:
gov.nasa.arc.brahms.common.IConstants, java.io.Serializable
Direct Known Subclasses:
ArrayAccess, ArrayCreation, ArrayInitializer, CollectionType, Comparison, Expression, JavaType, MetaType, ModelElement, Operand, ParameterValue, Statement, Unknown, UnknownType, ValueType

public class BrahmsObject
extends java.lang.Object
implements gov.nasa.arc.brahms.common.IConstants, java.io.Serializable

BrahmsObject is a generic object extended by all brahms data objects. It provides support for file name and line number in which an object occurs as well as list change and property change support for bound properties and bound lists.

Version:
25 July 2003
Author:
Ron van Hoof
See Also:
Serialized Form

Field Summary
 
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
BrahmsObject()
          Constructor, creates a new BrahmsObject
BrahmsObject(java.lang.String file, int line)
          Constructor, creates a new BrahmsObject which is located as brahms source code in the given file at the given line number.
 
Method Summary
 void delete()
          Deletes this BrahmsObject.
 void export(IFormat format, java.util.Properties p, java.io.DataOutputStream out)
          Exports this object in the given format with the given properties to the given stream.
 java.lang.String getFile()
          Returns the file name of the file in which the source code of this object is located.
 java.lang.String getID()
          Returns the unique identifier of the BrahmsObject.
 int getLine()
          Returns the line number in the file where the source code of this object begins.
 int getSerialNumber()
          Returns the serial number for this object
 boolean isBCC()
          Indicates whether this object was generated from Brahms Compiled Code.
 boolean isDynamic()
          Indicates whether the Brahms model element was created dynamically at runtime or was created at design time.
 boolean isLoaded()
          Returns whether the object is loaded for use in a Brahms virtual machine.
 boolean isResolved()
          Return whether the object is fully resolved for use in a Brahms virtual machine.
 void setBCC(boolean bcc)
          Sets whether this object was generated from Brahms Compiled Code.
 void setDynamic(boolean dynamic)
          Sets whether the Brahms model element was created dynamically at runtime or was created at design time.
 void setFile(java.lang.String file)
          Sets the file name of the file in which the source code of this object is located.
protected  void setID()
          Sets the unique identifier for the BrahmsObject.
protected  void setID(java.lang.String id)
          Sets the unique identifier for the BrahmsObject.
 void setLine(int line)
          Sets the line number in the file where the source code of this object begins.
 void setLoaded(boolean loaded)
          Set whether the object is loaded for use in a Brahms virtual machine.
 void setResolved(boolean resolved)
          Set whether the object is fully resolved for use in a Brahms virtual machine.
 void setSerialNumber(int sn)
          Sets the serial number for this object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BrahmsObject

public BrahmsObject()
Constructor, creates a new BrahmsObject


BrahmsObject

public BrahmsObject(java.lang.String file,
                    int line)
Constructor, creates a new BrahmsObject which is located as brahms source code in the given file at the given line number.

Parameters:
file - the name of the file
line - the line number in the file
Method Detail

setID

protected void setID()
Sets the unique identifier for the BrahmsObject.


setID

protected final void setID(java.lang.String id)
Sets the unique identifier for the BrahmsObject.

Parameters:
id - the unique identifier

getID

public final java.lang.String getID()
Returns the unique identifier of the BrahmsObject.

Returns:
String the unique identifier, null if no identifier is set.

setFile

public void setFile(java.lang.String file)
Sets the file name of the file in which the source code of this object is located.

Parameters:
file - the file name

getFile

public java.lang.String getFile()
Returns the file name of the file in which the source code of this object is located.

Returns:
String the file name

setLine

public void setLine(int line)
Sets the line number in the file where the source code of this object begins.

Parameters:
line - the line number

getLine

public int getLine()
Returns the line number in the file where the source code of this object begins.

Returns:
int the line number

setBCC

public void setBCC(boolean bcc)
Sets whether this object was generated from Brahms Compiled Code.

Parameters:
bcc - true if generated from Brahms Compiled Code, false if generated from source code.

isBCC

public boolean isBCC()
Indicates whether this object was generated from Brahms Compiled Code.

Returns:
boolean true if generated from Brahms Compiled Code, false if generated from source code.

setResolved

public void setResolved(boolean resolved)
Set whether the object is fully resolved for use in a Brahms virtual machine. A Brahms object must be resolved before it can be used in a simulation. If an object is not resolved it goes through a resolve routine in the virtual machine.

Note: The default value for this attribute is true for compatibility with other Brahms components.

Parameters:
resolved - true if resolved, false otherwise

isResolved

public boolean isResolved()
Return whether the object is fully resolved for use in a Brahms virtual machine. A Brahms object must be resolved before it can be used in a simulation. If an object is not resolved it goes through a resolve routine in the virtual machine.

Note: The default value for this attribute is true for compatibility with other Brahms components.

Returns:
boolean true if resolved, false otherwise

setLoaded

public void setLoaded(boolean loaded)
Set whether the object is loaded for use in a Brahms virtual machine. A Brahms object is considered loaded if it and its attributes are loaded. The object can remain unresolved. The virtual machine loads brahms objects when loading concepts. It is possible that a reference to an object is made that is not yet loaded. In that case the VM creates the object but keeps the loaded attribute set to false. During the execution of concepts objects marked as not loaded will be replaced by the loaded versions.

Note: The default value for this attribute is true for compatibility with other Brahms components.

Parameters:
loaded - true if loaded, false otherwise

isLoaded

public boolean isLoaded()
Returns whether the object is loaded for use in a Brahms virtual machine. A Brahms object is considered loaded if it and its attributes are loaded. The object can remain unresolved. The virtual machine loads brahms objects when loading concepts. It is possible that a reference to an object is made that is not yet loaded. In that case the VM creates the object but keeps the loaded attribute set to false. During the execution of concepts objects marked as not loaded will be replaced by the loaded versions.

Note: The default value for this attribute is true for compatibility with other Brahms components.

Returns:
boolean true if loaded, false otherwise

setDynamic

public void setDynamic(boolean dynamic)
Sets whether the Brahms model element was created dynamically at runtime or was created at design time.

Parameters:
dynamic - true if the object was created at runtime, false if it was created at design time.

isDynamic

public boolean isDynamic()
Indicates whether the Brahms model element was created dynamically at runtime or was created at design time.

Returns:
boolean true if the object was created at runtime, false if it was created at design time.

delete

public void delete()
Deletes this BrahmsObject. This method will make sure that the objects referencing this BrahmsObject will be properly cleaned up by removing all the references.

Note:This method is not implemented and requires an implementation by its sub classes that support the deletion. This method is placed here to enable polymorphism.


setSerialNumber

public void setSerialNumber(int sn)
Sets the serial number for this object

Parameters:
sn - the serial number

getSerialNumber

public int getSerialNumber()
Returns the serial number for this object

Returns:
int the serial number

export

public void export(IFormat format,
                   java.util.Properties p,
                   java.io.DataOutputStream out)
Exports this object in the given format with the given properties to the given stream.

Parameters:
format - the IFormat to export this object as
p - the Properties required for the format
out - the DataOutputStream to write the output to


Copyright © 1997-2012 All Rights Reserved.