|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IVariable
The IVariable interface is an interface to a variable specified in a frame and bound or not bound to a value. 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 and passed down through a parameter. (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.
Once a variable is assigned a value its value can no longer be changed. If on entering the activity the variable is not bound then in the activity the variable can be bound and its binding can be changed until the activity ends.
| Field Summary | |
|---|---|
static int |
COLLECTALL
The collect-all quantifier for a variable indicating multiple values fo the same type can be bound |
static int |
FOREACH
The for-each quantifier for a variable indicating only one value can be bound |
static int |
FORONE
The for-one quantifier for a variable indicating only one value can be bound |
| Method Summary | |
|---|---|
void |
addValue(boolean value)
Adds the specified value to the variable's binding. |
void |
addValue(byte value)
Adds the specified value to the variable's binding. |
void |
addValue(char value)
Adds the specified value to the variable's binding. |
void |
addValue(double value)
Adds the specified value to the variable's binding. |
void |
addValue(float value)
Adds the specified value to the variable's binding. |
void |
addValue(IConcept value)
Adds the specified value to the variable's binding. |
void |
addValue(int value)
Adds the specified value to the variable's binding. |
void |
addValue(IUnknown value)
Adds the 'unknown' value to the variable's binding. |
void |
addValue(long value)
Adds the specified value to the variable's binding. |
void |
addValue(java.lang.Object value)
Adds the specified variable to the variable's binding. |
void |
addValue(java.io.Serializable value)
Adds the specified variable to the variable's binding. |
void |
addValue(short value)
Adds the specified value to the variable's binding. |
void |
addValue(java.lang.String value)
Adds the specified value to the variable's binding. |
boolean |
getBooleanValue()
Returns the bound value of the variable. |
byte |
getByteValue()
Returns the bound value of the variable. |
char |
getCharValue()
Returns the bound value of the variable. |
IConcept |
getConceptValue()
Returns the bound value of the variable. |
double |
getDoubleValue()
Returns the bound value of the variable. |
float |
getFloatValue()
Returns the bound value of the variable. |
int |
getIntValue()
Returns the bound value of the variable. |
java.lang.Object |
getJavaObjectValue()
Returns the bound value of the variable. |
java.io.Serializable |
getJavaValue()
Deprecated. Use getJavaObjectValue instead |
long |
getLongValue()
Returns the bound value of the variable. |
java.lang.String |
getName()
Returns the variable name. |
int |
getQuantification()
Returns the variable's quantification, one of FORONE, FOREACH or COLLECTALL. |
short |
getShortValue()
Returns the bound value of the variable. |
java.lang.String |
getStringValue()
Returns the bound value of the variable. |
java.lang.String |
getSymbolValue()
Returns the bound value of the variable. |
IType |
getType()
Returns the type of the variable. |
IUnknown |
getUnknownValue()
Returns the bound value of the variable. |
java.util.Enumeration |
getValues()
Returns a list of the values bound to this variable. |
boolean |
hasMultipleValues()
Returns true if this variable is bound to multiple values. |
boolean |
isBound()
Indicates whether the variable is bound to a value. |
boolean |
isBoundAtStart()
Indicates whether the variable was bound to a value at the start of the activity in which the variable is used. |
boolean |
isValueUnknown()
Indicates whether the variable has as one of its values the value 'unknown' |
void |
setValue(boolean value)
Binds the variable to the specified value. |
void |
setValue(byte value)
Binds the variable to the specified value. |
void |
setValue(char value)
Binds the variable to the specified value. |
void |
setValue(double value)
Binds the variable to the specified value. |
void |
setValue(float value)
Binds the variable to the specified value. |
void |
setValue(IConcept value)
Binds the variable to the specified value. |
void |
setValue(int value)
Binds the variable to the specified value. |
void |
setValue(IUnknown value)
Binds the variable to the 'unknown' value. |
void |
setValue(long value)
Binds the variable to the specified value. |
void |
setValue(java.lang.Object value)
Binds the variable to the specified value. |
void |
setValue(java.io.Serializable value)
Binds the variable to the specified value. |
void |
setValue(short value)
Binds the variable to the specified value. |
void |
setValue(java.lang.String value)
Binds the variable to the specified value. |
| Field Detail |
|---|
static final int FORONE
static final int FOREACH
static final int COLLECTALL
| Method Detail |
|---|
java.lang.String getName()
throws ExternalException
ExternalException - if an internal error occurs
int getQuantification()
throws ExternalException
ExternalException - if an internal error occursFORONE,
FOREACH,
COLLECTALL
IType getType()
throws ExternalException
ExternalException - if an internal error occursIType
boolean isBound()
throws ExternalException
ExternalException - if an internal error occurs
boolean isBoundAtStart()
throws ExternalException
ExternalException - if an internal error occurs
boolean isValueUnknown()
throws ExternalException
ExternalException - if an internal error occurs
void setValue(int value)
throws VariableBoundException,
InvalidTypeException,
ExternalException
value - the value for the variable
VariableBoundException - if the variable was already bound at
the start of the activity in which this method is called
InvalidTypeException - the variable is of a different type then the
specified value and the types are not compatible
ExternalException - if an internal error occurs
void setValue(char value)
throws VariableBoundException,
InvalidTypeException,
ExternalException
value - the value for the variable
VariableBoundException - if the variable was already bound at
the start of the activity in which this method is called
InvalidTypeException - the variable is of a different type then the
specified value and the types are not compatible
ExternalException - if an internal error occurs
void setValue(byte value)
throws VariableBoundException,
InvalidTypeException,
ExternalException
value - the value for the variable
VariableBoundException - if the variable was already bound at
the start of the activity in which this method is called
InvalidTypeException - the variable is of a different type then the
specified value and the types are not compatible
ExternalException - if an internal error occurs
void setValue(short value)
throws VariableBoundException,
InvalidTypeException,
ExternalException
value - the value for the variable
VariableBoundException - if the variable was already bound at
the start of the activity in which this method is called
InvalidTypeException - the variable is of a different type then the
specified value and the types are not compatible
ExternalException - if an internal error occurs
void setValue(long value)
throws VariableBoundException,
InvalidTypeException,
ExternalException
value - the value for the variable
VariableBoundException - if the variable was already bound at
the start of the activity in which this method is called
InvalidTypeException - the variable is of a different type then the
specified value and the types are not compatible
ExternalException - if an internal error occurs
void setValue(float value)
throws VariableBoundException,
InvalidTypeException,
ExternalException
value - the value for the variable
VariableBoundException - if the variable was already bound at
the start of the activity in which this method is called
InvalidTypeException - the variable is of a different type then the
specified value and the types are not compatible
ExternalException - if an internal error occurs
void setValue(double value)
throws VariableBoundException,
InvalidTypeException,
ExternalException
value - the value for the variable
VariableBoundException - if the variable was already bound at
the start of the activity in which this method is called
InvalidTypeException - the variable is of a different type then the
specified value and the types are not compatible
ExternalException - if an internal error occurs
void setValue(boolean value)
throws VariableBoundException,
InvalidTypeException,
ExternalException
value - the value for the variable
VariableBoundException - if the variable was already bound at
the start of the activity in which this method is called
InvalidTypeException - the variable is of a different type then the
specified value and the types are not compatible
ExternalException - if an internal error occurs
void setValue(java.lang.String value)
throws VariableBoundException,
InvalidTypeException,
ExternalException
value - the value for the variable, if the variable type is a symbol then
the string will automatically be converted to a symbol.
VariableBoundException - if the variable was already bound at
the start of the activity in which this method is called
InvalidTypeException - the variable is of a different type then the
specified value and the types are not compatible
ExternalException - if an internal error occurs
void setValue(IConcept value)
throws VariableBoundException,
InvalidTypeException,
ExternalException
value - the value for the variable
VariableBoundException - if the variable was already bound at
the start of the activity in which this method is called
InvalidTypeException - the variable is of a different type then the
specified value and the types are not compatible
ExternalException - if an internal error occurs
void setValue(java.io.Serializable value)
throws VariableBoundException,
InvalidTypeException,
ExternalException
value - the value for the variable
VariableBoundException - if the variable was already bound at
the start of the activity in which this method is called
InvalidTypeException - the variable is of a different type then the
specified value and the types are not compatible
ExternalException - if an internal error occurs
void setValue(java.lang.Object value)
throws VariableBoundException,
InvalidTypeException,
ExternalException
value - the value for the variable
VariableBoundException - if the variable was already bound at
the start of the activity in which this method is called
InvalidTypeException - the variable is of a different type then the
specified value and the types are not compatible
ExternalException - if an internal error occurs
void setValue(IUnknown value)
throws VariableBoundException,
InvalidTypeException,
ExternalException
value - the value for the variable
VariableBoundException - if the variable was already bound at
the start of the activity in which this method is called
InvalidTypeException - the variable is of a different type then the
specified value and the types are not compatible
ExternalException - if an internal error occursIUnknown.UNKNOWN
int getIntValue()
throws VariableNotBoundException,
InvalidTypeException,
ExternalException
VariableNotBoundException - if the variable has no binding
InvalidTypeException - if the variable is of a different type
ExternalException - if an internal error occurs
char getCharValue()
throws VariableNotBoundException,
InvalidTypeException,
ExternalException
VariableNotBoundException - if the variable has no binding
InvalidTypeException - if the variable is of a different type
ExternalException - if an internal error occurs
byte getByteValue()
throws VariableNotBoundException,
InvalidTypeException,
ExternalException
VariableNotBoundException - if the variable has no binding
InvalidTypeException - if the variable is of a different type
ExternalException - if an internal error occurs
short getShortValue()
throws VariableNotBoundException,
InvalidTypeException,
ExternalException
VariableNotBoundException - if the variable has no binding
InvalidTypeException - if the variable is of a different type
ExternalException - if an internal error occurs
long getLongValue()
throws VariableNotBoundException,
InvalidTypeException,
ExternalException
VariableNotBoundException - if the variable has no binding
InvalidTypeException - if the variable is of a different type
ExternalException - if an internal error occurs
float getFloatValue()
throws VariableNotBoundException,
InvalidTypeException,
ExternalException
VariableNotBoundException - if the variable has no binding
InvalidTypeException - if the variable is of a different type
ExternalException - if an internal error occurs
double getDoubleValue()
throws VariableNotBoundException,
InvalidTypeException,
ExternalException
VariableNotBoundException - if the variable has no binding
InvalidTypeException - if the variable is of a different type
ExternalException - if an internal error occurs
boolean getBooleanValue()
throws VariableNotBoundException,
InvalidTypeException,
ExternalException
VariableNotBoundException - if the variable has no binding
InvalidTypeException - if the variable is of a different type
ExternalException - if an internal error occurs
java.lang.String getStringValue()
throws VariableNotBoundException,
InvalidTypeException,
ExternalException
VariableNotBoundException - if the variable has no binding
InvalidTypeException - if the variable is of a different type
ExternalException - if an internal error occurs
java.lang.String getSymbolValue()
throws VariableNotBoundException,
InvalidTypeException,
ExternalException
VariableNotBoundException - if the variable has no binding
InvalidTypeException - if the variable is of a different type
ExternalException - if an internal error occurs
IConcept getConceptValue()
throws VariableNotBoundException,
InvalidTypeException,
ExternalException
VariableNotBoundException - if the variable has no binding
InvalidTypeException - if the variable is of a different type
ExternalException - if an internal error occurs
@Deprecated
java.io.Serializable getJavaValue()
throws VariableNotBoundException,
InvalidTypeException,
ExternalException
VariableNotBoundException - if the variable has no binding
InvalidTypeException - if the variable is of a different type
ExternalException - if an internal error occurs
java.lang.Object getJavaObjectValue()
throws VariableNotBoundException,
InvalidTypeException,
ExternalException
VariableNotBoundException - if the variable has no binding
InvalidTypeException - if the variable is of a different type
ExternalException - if an internal error occurs
IUnknown getUnknownValue()
throws VariableNotBoundException,
InvalidTypeException,
ExternalException
VariableNotBoundException - if the variable has no binding
InvalidTypeException - if the value is not 'unknown'
ExternalException - if an internal error occursIUnknown.UNKNOWN
void addValue(int value)
throws VariableBoundException,
InvalidTypeException,
ExternalException
value - the value to be added to the binding of the variable
VariableBoundException - if the variable was already bound at
the start of the activity in which this method is called or if
the quantification of the variable is forone or foreach and a
value is already set for the variable.
InvalidTypeException - the variable is of a different type then the
specified value and the types are not compatible
ExternalException - if an internal error occurs
void addValue(char value)
throws VariableBoundException,
InvalidTypeException,
ExternalException
value - the value to be added to the binding of the variable
VariableBoundException - if the variable was already bound at
the start of the activity in which this method is called or if
the quantification of the variable is forone or foreach and a
value is already set for the variable.
InvalidTypeException - the variable is of a different type then the
specified value and the types are not compatible
ExternalException - if an internal error occurs
void addValue(byte value)
throws VariableBoundException,
InvalidTypeException,
ExternalException
value - the value to be added to the binding of the variable
VariableBoundException - if the variable was already bound at
the start of the activity in which this method is called or if
the quantification of the variable is forone or foreach and a
value is already set for the variable.
InvalidTypeException - the variable is of a different type then the
specified value and the types are not compatible
ExternalException - if an internal error occurs
void addValue(short value)
throws VariableBoundException,
InvalidTypeException,
ExternalException
value - the value to be added to the binding of the variable
VariableBoundException - if the variable was already bound at
the start of the activity in which this method is called or if
the quantification of the variable is forone or foreach and a
value is already set for the variable.
InvalidTypeException - the variable is of a different type then the
specified value and the types are not compatible
ExternalException - if an internal error occurs
void addValue(long value)
throws VariableBoundException,
InvalidTypeException,
ExternalException
value - the value to be added to the binding of the variable
VariableBoundException - if the variable was already bound at
the start of the activity in which this method is called or if
the quantification of the variable is forone or foreach and a
value is already set for the variable.
InvalidTypeException - the variable is of a different type then the
specified value and the types are not compatible
ExternalException - if an internal error occurs
void addValue(float value)
throws VariableBoundException,
InvalidTypeException,
ExternalException
value - the value to be added to the binding of the variable
VariableBoundException - if the variable was already bound at
the start of the activity in which this method is called or if
the quantification of the variable is forone or foreach and a
value is already set for the variable.
InvalidTypeException - the variable is of a different type then the
specified value and the types are not compatible
ExternalException - if an internal error occurs
void addValue(double value)
throws VariableBoundException,
InvalidTypeException,
ExternalException
value - the value to be added to the binding of the variable
VariableBoundException - if the variable was already bound at
the start of the activity in which this method is called or if
the quantification of the variable is forone or foreach and a
value is already set for the variable.
InvalidTypeException - the variable is of a different type then the
specified value and the types are not compatible
ExternalException - if an internal error occurs
void addValue(boolean value)
throws VariableBoundException,
InvalidTypeException,
ExternalException
value - the value to be added to the binding of the variable
VariableBoundException - if the variable was already bound at
the start of the activity in which this method is called or if
the quantification of the variable is forone or foreach and a
value is already set for the variable.
InvalidTypeException - the variable is of a different type then the
specified value and the types are not compatible
ExternalException - if an internal error occurs
void addValue(java.lang.String value)
throws VariableBoundException,
InvalidTypeException,
ExternalException
value - the value to be added to the binding of the variable
VariableBoundException - if the variable was already bound at
the start of the activity in which this method is called or if
the quantification of the variable is forone or foreach and a
value is already set for the variable.
InvalidTypeException - the variable is of a different type then the
specified value and the types are not compatible
ExternalException - if an internal error occurs
void addValue(IConcept value)
throws VariableBoundException,
InvalidTypeException,
ExternalException
value - the value to be added to the binding of the variable
VariableBoundException - if the variable was already bound at
the start of the activity in which this method is called or if
the quantification of the variable is forone or foreach and a
value is already set for the variable.
InvalidTypeException - the variable is of a different type then the
specified value and the types are not compatible
ExternalException - if an internal error occurs
void addValue(java.io.Serializable value)
throws VariableBoundException,
InvalidTypeException,
ExternalException
value - the value to be added to the binding of the variable
VariableBoundException - if the variable was already bound at
the start of the activity in which this method is called or if
the quantification of the variable is forone or foreach and a
value is already set for the variable.
InvalidTypeException - the variable is of a different type then the
specified value and the types are not compatible
ExternalException - if an internal error occurs
void addValue(java.lang.Object value)
throws VariableBoundException,
InvalidTypeException,
ExternalException
value - the value to be added to the binding of the variable
VariableBoundException - if the variable was already bound at
the start of the activity in which this method is called or if
the quantification of the variable is forone or foreach and a
value is already set for the variable.
InvalidTypeException - the variable is of a different type then the
specified value and the types are not compatible
ExternalException - if an internal error occurs
void addValue(IUnknown value)
throws VariableBoundException,
InvalidTypeException,
ExternalException
value - the value to be added to the binding of the variable
VariableBoundException - if the variable was already bound at
the start of the activity in which this method is called or if
the quantification of the variable is forone or foreach and a
value is already set for the variable.
InvalidTypeException - the variable is of a different type then the
specified value and the types are not compatible
ExternalException - if an internal error occursIUnknown.UNKNOWN
java.util.Enumeration getValues()
throws VariableNotBoundException,
ExternalException
VariableNotBoundException - if the variable has no binding
ExternalException - if an internal error occurs
boolean hasMultipleValues()
throws ExternalException
ExternalException - if an internal error occurs
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||