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

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

public class Variable
extends NamedModelElement

A Variable is used in Workframes and Thoughtframes. Variables allow for the writing of more generic re-usable workframes and thoughtframes. Before a variable can be used it has to be declared. The scope of the variable is bound to the frame it is declared in. A variable that is not declared within the workframe it is used in, must be declared higher up in the activity-tree the workframe is part of. (The activity tree is created through composite activities.)

Variables initially do not have a value assigned but get a value assigned either through preconditions (assigned variable) when a precondition matched with a belief or fact, or through activities (unassigned variable) where the activity assigns a value to the variable.

Version:
$Revision: 1.5 $ $Date: 2009/11/23 19:08:56 $ $Author: rnado $
Author:
Ron van Hoof
See Also:
Workframe, Thoughtframe, Serialized Form

Field Summary
static Variable ANONYMOUS_VARIABLE
          The unique anonymous variable that matches anything but binds to nothing
 
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
Variable()
           
Variable(java.lang.String name)
           
Variable(java.lang.String file, int line)
           
Variable(java.lang.String name, java.lang.String file, int line)
           
 
Method Summary
 java.lang.String getFullyQualifiedName()
          Returns the fully qualified name of the variable.
 int getQuantification()
           
 Type getType()
           
 boolean isAnonymous()
          Determines whether a variable is the anonymous variable.
 boolean isAssigned()
           
 boolean isLocal()
           
 void setAssigned(boolean value)
           
protected  void setID()
          Sets the unique identifier.
 void setLocal(boolean value)
           
 void setOwner(BFrame frm)
           
 void setQuantification(int quantification)
           
 void setType(Type type)
           
 java.lang.String toString()
          Returns a string representation of the named model element.
 
Methods inherited from class gov.nasa.arc.brahms.common.data.NamedModelElement
getDisplayText, getName, getOwner, setDisplayText, setFullyQualifiedName, setName, setOwner
 
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, setLine, setLoaded, setResolved, setSerialNumber
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ANONYMOUS_VARIABLE

public static final Variable ANONYMOUS_VARIABLE
The unique anonymous variable that matches anything but binds to nothing

Constructor Detail

Variable

public Variable()

Variable

public Variable(java.lang.String name)

Variable

public Variable(java.lang.String file,
                int line)

Variable

public Variable(java.lang.String name,
                java.lang.String file,
                int line)
Method Detail

setID

protected void setID()
Sets the unique identifier.

Overrides:
setID in class BrahmsObject

setAssigned

public void setAssigned(boolean value)

isAssigned

public boolean isAssigned()

setLocal

public void setLocal(boolean value)

isLocal

public boolean isLocal()

setQuantification

public void setQuantification(int quantification)

getQuantification

public int getQuantification()

setType

public void setType(Type type)

getType

public Type getType()

setOwner

public void setOwner(BFrame frm)

getFullyQualifiedName

public java.lang.String getFullyQualifiedName()
Returns the fully qualified name of the variable. This is just the name of the parameter itself

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

isAnonymous

public boolean isAnonymous()
Determines whether a variable is the anonymous variable. The anonymous variable matches anything but does not need to be declared and does not get a variable binding.

Returns:
boolean true if this is the anonymous variable, else false

toString

public java.lang.String toString()
Description copied from class: NamedModelElement
Returns a string representation of the named model element.

Overrides:
toString in class NamedModelElement
Returns:
String the string representation


Copyright © 1997-2012 All Rights Reserved.