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

java.lang.Object
  extended by gov.nasa.arc.brahms.common.rt.BrahmsObjectCtx
      extended by gov.nasa.arc.brahms.common.rt.ParameterCtx
All Implemented Interfaces:
gov.nasa.arc.brahms.common.IConstants, IBrahmsObjectCtx, IRuntimeConstants, java.io.Serializable

public class ParameterCtx
extends BrahmsObjectCtx
implements gov.nasa.arc.brahms.common.IConstants

The ParameterCtx represents a value assigned to a an attribute of an activity. The parameter can be a value that was directly assigned to an attribute or a value assigned to an attribute through a parameter defined for the activity. The value assigned through a parameter can be a variable.

Version:
$Revision: 1.4 $ $Date: 2009/11/23 19:12:22 $ $Author: rnado $
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
 
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
ParameterCtx(ActivityCtx act)
          Constructor, creates a new ParameterCtx for the specified activity.
ParameterCtx(ActivityCtx act, java.lang.String name)
          Constructor, creates a new ParameterCtx for the specified activity.
 
Method Summary
 ActivityCtx getActivity()
          Returns the activity in which this parameter context is used
 boolean getBooleanValue()
          Returns the boolean value
 byte getByteValue()
          Returns the byte value
 char getCharValue()
          Returns the char value
 Concept getConceptValue()
          Returns the concept value, is a concept and not a ConceptCtx since the value of a parameter can potentially be a class.
 double getDoubleValue()
          Returns the double value
 float getFloatValue()
          Returns the float value
 int getIntValue()
          Returns the integer value
 java.lang.Object getJavaValue()
          Returns the Java Object value
 long getLongValue()
          Returns the long value
 java.lang.String getName()
          Returns the name of the parameter used in the activity.
 short getShortValue()
          Returns the short value
 java.lang.String getStringValue()
          Returns the string value
 java.lang.String getSymbolValue()
          Returns the symbol value
 int getType()
          Returns the type of the value
 Unknown getUnknownValue()
          Returns the unknown value.
 VariableCtx getVariable()
          Returns the variable assigning the value to this parameter.
 void setActivity(ActivityCtx act)
          Sets the activity in which this parameter context is used
 void setName(java.lang.String name)
          Sets the name of the parameter used in the activity.
 void setType(int type)
          Sets the type of the value
 void setValue(boolean value)
          Sets the boolean value
 void setValue(byte value)
          Sets the byte value
 void setValue(char value)
          Sets the character value
 void setValue(Concept value)
          Sets the concept value, must be set as a concept and not as a ConceptCtx since the value of a parameter can potentially be a class.
 void setValue(double value)
          Sets the double value
 void setValue(float value)
          Sets the float value
 void setValue(int value)
          Sets the integer value
 void setValue(long value)
          Sets the long value
 void setValue(java.lang.Object value)
          Sets the Java Object value.
 void setValue(short value)
          Sets the short value
 void setValue(java.lang.String value, boolean symbol)
          Sets the string or symbol value
 void setValue(Unknown value)
          Sets the value to unknown.
 void setVariable(VariableCtx var)
          Sets the variable assigning the value to this parameter.
 
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, toString, wait, wait, wait
 

Constructor Detail

ParameterCtx

public ParameterCtx(ActivityCtx act)
             throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Constructor, creates a new ParameterCtx for the specified activity.

Parameters:
act - the ActivityCtx in which the paremeter is used.
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if the activity is null

ParameterCtx

public ParameterCtx(ActivityCtx act,
                    java.lang.String name)
             throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Constructor, creates a new ParameterCtx for the specified activity.

Parameters:
act - the ActivityCtx in which the paremeter is used.
name - the name of the parameter
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if the activity and/or name are null
Method Detail

setActivity

public void setActivity(ActivityCtx act)
                 throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Sets the activity in which this parameter context is used

Parameters:
act - the ActivityCtx in which this parameter context is used
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if a null activity is specified

getActivity

public ActivityCtx getActivity()
                        throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the activity in which this parameter context is used

Returns:
ActivityCtx the activity in which this parameter context is used
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if no activity is specified

setName

public void setName(java.lang.String name)
             throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Sets the name of the parameter used in the activity. If no parameter is used to set a value in the activity an empty name is to be specified (""), in that case a value was specified in the activity itself.

Parameters:
name - the name of the parameter assigning the value, or "" if no parameter assigned the value
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if a null name is specified

getName

public java.lang.String getName()
                         throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the name of the parameter used in the activity. If no parameter is used to set a value in the activity an empty name is specified (""), in that case a value was specified in the activity itself.

Returns:
String the name of the parameter assigning the value, or "" if no parameter assigned the value
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if no name (null) is specified

setType

public void setType(int type)
             throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Sets the type of the value

Parameters:
type - the value type
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an invalid type is specified
See Also:
IConstants.INT, IConstants.CHAR, IConstants.BYTE, IConstants.SHORT, IConstants.LONG, IConstants.FLOAT, IConstants.DOUBLE, IConstants.BOOLEAN, IConstants.STRING, IConstants.SYMBOL, IConstants.UDT, IConstants.JAVA_TYPE, IConstants.UNKNOWN

getType

public int getType()
            throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the type of the value

Returns:
int the value type
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if no type is specified
See Also:
IConstants.INT, IConstants.CHAR, IConstants.BYTE, IConstants.SHORT, IConstants.LONG, IConstants.FLOAT, IConstants.DOUBLE, IConstants.BOOLEAN, IConstants.STRING, IConstants.SYMBOL, IConstants.UDT, IConstants.JAVA_TYPE, IConstants.UNKNOWN

setValue

public void setValue(int value)
              throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Sets the integer value

Parameters:
value - the integer value
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an internal error occurs

setValue

public void setValue(char value)
              throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Sets the character value

Parameters:
value - the character value
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an internal error occurs

setValue

public void setValue(byte value)
              throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Sets the byte value

Parameters:
value - the byte value
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an internal error occurs

setValue

public void setValue(short value)
              throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Sets the short value

Parameters:
value - the short value
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an internal error occurs

setValue

public void setValue(long value)
              throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Sets the long value

Parameters:
value - the long value
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an internal error occurs

setValue

public void setValue(float value)
              throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Sets the float value

Parameters:
value - the float value
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an internal error occurs

setValue

public void setValue(double value)
              throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Sets the double value

Parameters:
value - the double value
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an internal error occurs

setValue

public void setValue(boolean value)
              throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Sets the boolean value

Parameters:
value - the boolean value
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an internal error occurs

setValue

public void setValue(java.lang.String value,
                     boolean symbol)
              throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Sets the string or symbol value

Parameters:
value - the string or symbol value
symbol - is value a symbol (true) or a string (false)
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an internal error occurs

setValue

public void setValue(Concept value)
              throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Sets the concept value, must be set as a concept and not as a ConceptCtx since the value of a parameter can potentially be a class. Classes don't have contexts.

Parameters:
value - the concept value (Concept)
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an internal error occurs

setValue

public void setValue(java.lang.Object value)
              throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Sets the Java Object value.

Parameters:
value - the Java Object
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an internal error occurs

setValue

public void setValue(Unknown value)
              throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Sets the value to unknown.

Parameters:
value - the unknown value (Unknown)
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an internal error occurs

getIntValue

public int getIntValue()
                throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the integer value

Returns:
int the integer value
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if this value does not contain an integer

getCharValue

public char getCharValue()
                  throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the char value

Returns:
char the char value
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if this value does not contain a character

getByteValue

public byte getByteValue()
                  throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the byte value

Returns:
byte the byte value
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if this value does not contain a byte

getShortValue

public short getShortValue()
                    throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the short value

Returns:
short the short value
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if this value does not contain a short

getLongValue

public long getLongValue()
                  throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the long value

Returns:
long the long value
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if this value does not contain a long

getFloatValue

public float getFloatValue()
                    throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the float value

Returns:
float the float value
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if this value does not contain a float

getDoubleValue

public double getDoubleValue()
                      throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the double value

Returns:
double the double value
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if this value does not contain a double

getBooleanValue

public boolean getBooleanValue()
                        throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the boolean value

Returns:
boolean the boolean value
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if this value does not contain a boolean

getSymbolValue

public java.lang.String getSymbolValue()
                                throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the symbol value

Returns:
String the symbol value
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if this value does not contain a symbol

getStringValue

public java.lang.String getStringValue()
                                throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the string value

Returns:
String the string value
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if this value does not contain a string

getConceptValue

public Concept getConceptValue()
                        throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the concept value, is a concept and not a ConceptCtx since the value of a parameter can potentially be a class. Classes don't have contexts.

Returns:
Concept the concept value
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if this value does not contain a concept

getJavaValue

public java.lang.Object getJavaValue()
                              throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the Java Object value

Returns:
Object the Java value
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if this value does not contain a Java Object

getUnknownValue

public Unknown getUnknownValue()
                        throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the unknown value.

Returns:
Unknown the unknown value
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if this value is not 'unknown'

setVariable

public void setVariable(VariableCtx var)
Sets the variable assigning the value to this parameter.

Parameters:
var - the VariableCtx assigning the value

getVariable

public VariableCtx getVariable()
Returns the variable assigning the value to this parameter.

Returns:
VariableCtx the variable assigning the value, null if no variable assigned the value


Copyright © 1997-2012 All Rights Reserved.