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

java.lang.Object
  extended by gov.nasa.arc.brahms.common.rt.Value
All Implemented Interfaces:
gov.nasa.arc.brahms.common.IConstants

public class Value
extends java.lang.Object
implements gov.nasa.arc.brahms.common.IConstants

The value object models a value bound in a variable context. Depending on the type of the variable a specific value is defined. Each value object represents one single value, never a list of values or multiple values of different types. A list of values is maintained by the binding variable context.

Version:
$Revision: 1.4 $ $Date: 2009/11/23 19:12:22 $ $Author: rnado $
Author:
Ron van Hoof
See Also:
VariableCtx

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
Value(VariableCtx var, boolean value)
          Constructor, creates a new boolean value for the specified variable contex
Value(VariableCtx var, java.lang.Boolean value)
          Constructor, creates a new boolean value for the specified variable contex
Value(VariableCtx var, java.lang.Byte value)
          Constructor, creates a new byte value for the specified variable context
Value(VariableCtx var, java.lang.Character value)
          Constructor, creates a new char value for the specified variable context
Value(VariableCtx var, double value)
          Constructor, creates a new double value for the specified variable context
Value(VariableCtx var, java.lang.Double value)
          Constructor, creates a new double value for the specified variable context
Value(VariableCtx var, java.lang.Float value)
          Constructor, creates a new float value for the specified variable context
Value(VariableCtx var, IConceptCtx value)
          Constructor, creates a new concept value for the specified variable contex
Value(VariableCtx var, int value)
          Constructor, creates a new integer value for the specified variable context
Value(VariableCtx var, java.lang.Integer value)
          Constructor, creates a new integer value for the specified variable context
Value(VariableCtx var, long value)
          Constructor, creates a new long value for the specified variable context
Value(VariableCtx var, java.lang.Long value)
          Constructor, creates a new long value for the specified variable context
Value(VariableCtx var, java.lang.Object value)
          Constructor, creates a new concept value for the specified variable context
Value(VariableCtx var, java.lang.Short value)
          Constructor, creates a new short value for the specified variable context
Value(VariableCtx var, java.lang.String value, boolean symbol)
          Constructor, creates a new string or symbol value for the specified variable contex
Value(VariableCtx var, Unknown value)
          Constructor, creates an unknown value for the specified variable contex
 
Method Summary
 boolean equals(java.lang.Object value)
          Tests two value objects for equality
 boolean getBooleanValue()
          Returns the boolean value
 byte getByteValue()
          Returns the byte value
 char getCharValue()
          Returns the char value
 IConceptCtx getConceptValue()
          Returns the concept value
 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
 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
 java.lang.Object getValue()
          Returns the value as an object.
 VariableCtx getVariable()
          Returns the variable binding this value.
 void setType(int type)
          Sets the type of the value
 void setValue(boolean value)
          Sets the boolean value
 void setValue(java.lang.Boolean value)
          Sets the boolean value
 void setValue(java.lang.Byte value)
          Sets the byte value
 void setValue(java.lang.Character value)
          Sets the char value
 void setValue(double value)
          Sets the double value
 void setValue(java.lang.Double value)
          Sets the double value
 void setValue(java.lang.Float value)
          Sets the float value
 void setValue(IConceptCtx value)
          Sets the concept value
 void setValue(int value)
          Sets the integer value
 void setValue(java.lang.Integer value)
          Sets the integer value
 void setValue(long value)
          Sets the long value
 void setValue(java.lang.Long value)
          Sets the long value
 void setValue(java.lang.Object value)
          Sets the Java Object value
 void setValue(java.lang.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 binding this value.
 java.lang.String toString()
          Returns a string representation of the Value.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Value

public Value(VariableCtx var,
             int value)
      throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Constructor, creates a new integer value for the specified variable context

Parameters:
var - the variable context in which this value is bound
value - the integer value
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an error occurs in creating the value

Value

public Value(VariableCtx var,
             java.lang.Integer value)
      throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Constructor, creates a new integer value for the specified variable context

Parameters:
var - the variable context in which this value is bound
value - the integer value
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an error occurs in creating the value

Value

public Value(VariableCtx var,
             java.lang.Character value)
      throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Constructor, creates a new char value for the specified variable context

Parameters:
var - the variable context in which this value is bound
value - the character value
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an error occurs in creating the value

Value

public Value(VariableCtx var,
             java.lang.Byte value)
      throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Constructor, creates a new byte value for the specified variable context

Parameters:
var - the variable context in which this value is bound
value - the byte value
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an error occurs in creating the value

Value

public Value(VariableCtx var,
             java.lang.Short value)
      throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Constructor, creates a new short value for the specified variable context

Parameters:
var - the variable context in which this value is bound
value - the short value
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an error occurs in creating the value

Value

public Value(VariableCtx var,
             long value)
      throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Constructor, creates a new long value for the specified variable context

Parameters:
var - the variable context in which this value is bound
value - the long value
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an error occurs in creating the value

Value

public Value(VariableCtx var,
             java.lang.Long value)
      throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Constructor, creates a new long value for the specified variable context

Parameters:
var - the variable context in which this value is bound
value - the long value
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an error occurs in creating the value

Value

public Value(VariableCtx var,
             java.lang.Float value)
      throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Constructor, creates a new float value for the specified variable context

Parameters:
var - the variable context in which this value is bound
value - the float value
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an error occurs in creating the value

Value

public Value(VariableCtx var,
             double value)
      throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Constructor, creates a new double value for the specified variable context

Parameters:
var - the variable context in which this value is bound
value - the double value
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an error occurs in creating the value

Value

public Value(VariableCtx var,
             java.lang.Double value)
      throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Constructor, creates a new double value for the specified variable context

Parameters:
var - the variable context in which this value is bound
value - the double value
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an error occurs in creating the value

Value

public Value(VariableCtx var,
             boolean value)
      throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Constructor, creates a new boolean value for the specified variable contex

Parameters:
var - the variable context in which this value is bound
value - the boolean value
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an error occurs in creating the value

Value

public Value(VariableCtx var,
             java.lang.Boolean value)
      throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Constructor, creates a new boolean value for the specified variable contex

Parameters:
var - the variable context in which this value is bound
value - the boolean value
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an error occurs in creating the value

Value

public Value(VariableCtx var,
             java.lang.String value,
             boolean symbol)
      throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Constructor, creates a new string or symbol value for the specified variable contex

Parameters:
var - the variable context in which this value is bound
value - the string or symbol value
symbol - defines whether the value is a symbol, if false value is a string
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an error occurs in creating the value

Value

public Value(VariableCtx var,
             IConceptCtx value)
      throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Constructor, creates a new concept value for the specified variable contex

Parameters:
var - the variable context in which this value is bound
value - the concept value
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an error occurs in creating the value

Value

public Value(VariableCtx var,
             java.lang.Object value)
      throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Constructor, creates a new concept value for the specified variable context

Parameters:
var - the variable context in which this value is bound
value - the concept value
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an error occurs in creating the value

Value

public Value(VariableCtx var,
             Unknown value)
      throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Constructor, creates an unknown value for the specified variable contex

Parameters:
var - the variable context in which this value is bound
value - the unknown value
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an error occurs in creating the value
Method Detail

setVariable

public final void setVariable(VariableCtx var)
                       throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Sets the variable binding this value.

Parameters:
var - the VariableCtx binding this value
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if a null variable is specified

getVariable

public final VariableCtx getVariable()
                              throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the variable binding this value.

Returns:
VariableCtx the variable binding this value
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if no variable is specified

setType

public final 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 final 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 final 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 final void setValue(java.lang.Integer 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 final void setValue(java.lang.Character value)
                    throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Sets the char value

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

setValue

public final void setValue(java.lang.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 final void setValue(java.lang.Short value)
                    throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Sets the short value

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

setValue

public final 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 final void setValue(java.lang.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 final void setValue(java.lang.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 final 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 final void setValue(java.lang.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 final 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 final void setValue(java.lang.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 final 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 final void setValue(IConceptCtx value)
                    throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Sets the concept value

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

setValue

public final 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 final 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 final 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 final 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 final byte getByteValue()
                        throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the byte value

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

getShortValue

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

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

getLongValue

public final 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 final float getFloatValue()
                          throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the float value

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

getDoubleValue

public final 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 final 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 final 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 final 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 final IConceptCtx getConceptValue()
                                  throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the concept value

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

getJavaValue

public final 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 final 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

getValue

public final java.lang.Object getValue()
                                throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the value as an object.

Returns:
Object the value represented by this Value instance
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an internal error occurs

equals

public final boolean equals(java.lang.Object value)
Tests two value objects for equality

Overrides:
equals in class java.lang.Object
Parameters:
value - the value to be compared, can be a Value object or one of Integer, Double, Boolean, String or IConceptCtx
Returns:
true if the two values are equal, false otherwise

toString

public final java.lang.String toString()
Returns a string representation of the Value.

Overrides:
toString in class java.lang.Object
Returns:
String the string representation


Copyright © 1997-2012 All Rights Reserved.