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

java.lang.Object
  extended by gov.nasa.arc.brahms.common.data.BrahmsObject
      extended by gov.nasa.arc.brahms.common.data.Operand
All Implemented Interfaces:
IAssignmentLhs, gov.nasa.arc.brahms.common.IConstants, java.io.Serializable
Direct Known Subclasses:
VMOperand

public class Operand
extends BrahmsObject
implements IAssignmentLhs

class Operand

Version:
$Revision: 1.5 $ $Date: 2009/11/23 19:08:56 $ $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
 
Constructor Summary
Operand()
           
Operand(java.lang.Boolean b)
           
Operand(java.lang.Byte bt)
           
Operand(java.lang.Character c)
           
Operand(Concept concept)
           
Operand(Concept concept, Attribute attribute)
           
Operand(Current current)
           
Operand(Current current, Attribute attribute)
           
Operand(java.lang.Double d)
           
Operand(java.lang.Float f)
           
Operand(IExpression expr)
           
Operand(java.lang.Integer i)
           
Operand(java.lang.Long l)
           
Operand(java.lang.Object value)
           
Operand(java.lang.Object object, Attribute property)
          Constructor, creates a new operand referencing the specified Java object and property.
Operand(Parameter parm)
           
Operand(Parameter parm, Attribute attribute)
           
Operand(java.lang.Short st)
           
Operand(java.lang.String s)
           
Operand(java.lang.String s, boolean symbol)
           
Operand(Variable var)
           
Operand(Variable var, Attribute attribute)
           
 
Method Summary
 Attribute getAttribute()
           
 java.lang.Object getCollectionIndex()
          Returns the collection index.
 int getCollectionIndexType()
          Returns the type of value for the collection index.
 IExpression getExpression()
           
 NamedModelElement getObject()
           
 int getObjectType()
           
 int getOperandType()
           
 void getParameters(java.util.LinkedList ll)
          Returns a list of all the parameters used in the operand.
 java.lang.Object getValue()
           
 int getValueType()
           
 int getValueTypeIndicator()
          Returns the type of value this operand represents, if the operand is a value it uses the value type of the value, if it is a concept or current it indicates UDT as the value type, if it is unknown it indicates unknown if the value is a parameter or variable it will return the type for that parameter or variable.
 void getVariables(java.util.LinkedList ll)
          Returns a list of all the variables used in the operand.
 boolean isAnonymous()
          Returns whether the operand is an anonymous variable
 boolean isUnknown()
          Returns whether the operand value is 'unknown'.
 void setAttribute(Attribute att)
           
 void setCollectionIndex(java.lang.Integer index)
          Sets the collection index specified by an Integer.
 void setCollectionIndex(Parameter par)
          Sets the collection index specified by a parameter.
 void setCollectionIndex(java.lang.String index)
          Sets the collection index specified by a String.
 void setCollectionIndex(Variable var)
          Sets the collection index specified by a variable.
 void setExpression(IExpression expr)
           
protected  void setID()
          Sets the unique identifier.
 void setObject(Concept concept)
           
 void setObject(Current current)
           
 void setObject(Parameter parm)
           
 void setObject(Variable var)
           
 void setObjectType(int type)
           
 void setOperandType(int type)
           
 void setUnknown()
          Sets the value of the operand to unknown, setting the types to UnknownType.
 void setValue(java.lang.Boolean b)
           
 void setValue(java.lang.Byte bt)
           
 void setValue(java.lang.Character c)
           
 void setValue(java.lang.Double d)
           
 void setValue(java.lang.Float f)
           
 void setValue(java.lang.Integer i)
           
 void setValue(java.lang.Long l)
           
 void setValue(java.lang.Object value)
           
 void setValue(java.lang.Short st)
           
 void setValue(java.lang.String s)
           
 void setValue(java.lang.String s, boolean symbol)
           
 void setValueType(int type)
           
 java.lang.String 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, setLine, setLoaded, setResolved, setSerialNumber
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface gov.nasa.arc.brahms.common.data.IAssignmentLhs
export
 

Constructor Detail

Operand

public Operand()

Operand

public Operand(Concept concept)

Operand

public Operand(Current current)

Operand

public Operand(Variable var)

Operand

public Operand(Parameter parm)

Operand

public Operand(Concept concept,
               Attribute attribute)

Operand

public Operand(Current current,
               Attribute attribute)

Operand

public Operand(Variable var,
               Attribute attribute)

Operand

public Operand(Parameter parm,
               Attribute attribute)

Operand

public Operand(java.lang.Integer i)

Operand

public Operand(java.lang.Character c)

Operand

public Operand(java.lang.Byte bt)

Operand

public Operand(java.lang.Short st)

Operand

public Operand(java.lang.Long l)

Operand

public Operand(java.lang.Float f)

Operand

public Operand(java.lang.Double d)

Operand

public Operand(java.lang.Boolean b)

Operand

public Operand(java.lang.String s)

Operand

public Operand(java.lang.String s,
               boolean symbol)

Operand

public Operand(java.lang.Object value)

Operand

public Operand(java.lang.Object object,
               Attribute property)
Constructor, creates a new operand referencing the specified Java object and property. This is only used for transfer definitions in a request for beliefs from a remote agent

Parameters:
object - the Java object referenced by the operand
attribute - an attribute representing a property of the Java object

Operand

public Operand(IExpression expr)
Method Detail

setID

protected void setID()
Sets the unique identifier.

Overrides:
setID in class BrahmsObject

setUnknown

public void setUnknown()
Sets the value of the operand to unknown, setting the types to UnknownType.


isUnknown

public boolean isUnknown()
Returns whether the operand value is 'unknown'.

Returns:
boolean true if the operand value is 'unknown' false otherwise.

isAnonymous

public boolean isAnonymous()
Returns whether the operand is an anonymous variable

Returns:
boolean true if the operand an anonymous variable, false otherwise.

setOperandType

public void setOperandType(int type)

getOperandType

public int getOperandType()

setObject

public void setObject(Concept concept)

setObject

public void setObject(Current current)

setObject

public void setObject(Variable var)

setObject

public void setObject(Parameter parm)

getObject

public NamedModelElement getObject()

setObjectType

public void setObjectType(int type)

getObjectType

public int getObjectType()

setAttribute

public void setAttribute(Attribute att)

getAttribute

public Attribute getAttribute()

setCollectionIndex

public void setCollectionIndex(Variable var)
Sets the collection index specified by a variable.

Parameters:
var - the Variable with the collection index

setCollectionIndex

public void setCollectionIndex(Parameter par)
Sets the collection index specified by a parameter.

Parameters:
par - the Parameter with the collection index

setCollectionIndex

public void setCollectionIndex(java.lang.String index)
Sets the collection index specified by a String.

Parameters:
index - the collection index

setCollectionIndex

public void setCollectionIndex(java.lang.Integer index)
Sets the collection index specified by an Integer.

Parameters:
index - the collection index

getCollectionIndex

public java.lang.Object getCollectionIndex()
Returns the collection index.

Returns:
Object one of String, Integer, Parameter or Variable

getCollectionIndexType

public int getCollectionIndexType()
Returns the type of value for the collection index.

Returns:
int the collection index type (INT, STRING, VARIABLE, PARAMETER)

setValue

public void setValue(java.lang.Integer i)

setValue

public void setValue(java.lang.Character c)

setValue

public void setValue(java.lang.Byte bt)

setValue

public void setValue(java.lang.Short st)

setValue

public void setValue(java.lang.Long l)

setValue

public void setValue(java.lang.Float f)

setValue

public void setValue(java.lang.Double d)

setValue

public void setValue(java.lang.Boolean b)

setValue

public void setValue(java.lang.String s)

setValue

public void setValue(java.lang.String s,
                     boolean symbol)

setValue

public void setValue(java.lang.Object value)

getValue

public java.lang.Object getValue()

setValueType

public void setValueType(int type)

getValueType

public int getValueType()

setExpression

public void setExpression(IExpression expr)

getExpression

public IExpression getExpression()

getValueTypeIndicator

public int getValueTypeIndicator()
Returns the type of value this operand represents, if the operand is a value it uses the value type of the value, if it is a concept or current it indicates UDT as the value type, if it is unknown it indicates unknown if the value is a parameter or variable it will return the type for that parameter or variable.

Returns:
int the value type indicator for this operand

getVariables

public void getVariables(java.util.LinkedList ll)
Returns a list of all the variables used in the operand. Returns an empty list if no variables are used. Does not include anonymous variables as these can never receive a binding

Parameters:
ll - the LinkedList to which to add the variables used in the operand.

getParameters

public void getParameters(java.util.LinkedList ll)
Returns a list of all the parameters used in the operand. Returns an empty list if no parameters are used.

Parameters:
ll - the LinkedList to which to add the parameters used in the operand.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 1997-2012 All Rights Reserved.