Rule Execution Server API

ilog.rules.factory
Class IlrVariable

java.lang.Object
  extended by ilog.rules.factory.IlrValue
      extended by ilog.rules.factory.IlrVariable
All Implemented Interfaces:
IlrAssignable, ilog.rules.factory.IlrRulesetElement, IlrVariableElement, Serializable

public class IlrVariable
extends IlrValue
implements IlrAssignable, IlrVariableElement

This class represents a variable binding of the rule language.

Warning: Serialized objects of this class will not be compatible with future releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of IBM Decision Server.

See Also:
Serialized Form

Field Summary
protected  boolean rulesetVariable
           
 
Constructor Summary
IlrVariable(IlrReflect reflect, String definitionName, Class type)
          Constructs a variable binding.
IlrVariable(String definitionName, IlrType type)
          Constructs a variable binding.
IlrVariable(String name, IlrValue value)
          Constructs a variable binding.
 
Method Summary
 Object exploreAssignable(IlrFactoryExplorer explorer)
          This method explores the variable using a factory explorer.
 Object exploreValue(IlrFactoryExplorer explorer)
          This method explores the variable using a factory explorer.
 String getName()
          Gets the name of the variable.
 IlrPackageFactory getPackage()
          Returns the package in which the variable is defined in case this variable models a package variable.
 String getShortName()
          Gets the short name of the variable
 IlrValue getValue()
          Gets the value of the variable.
 boolean isAssignableFrom(IlrValue value)
          Checks whether the value value can be assigned to the variable.
 boolean isEventCondition()
          Returns whether this value is, or is bound to, the result of a condition, and this condition is an event condition.
 void setName(String name)
          Sets the name of the variable.
 void setValue(IlrValue value)
          Sets the value of the variable.
 
Methods inherited from class ilog.rules.factory.IlrValue
add, divide, getField, getReflect, getType, getXOMType, invokeEquals, isConstant, isEvent, isNull, multiply, remainder, subtract, testAfter, testAfter, testBefore, testBefore, testEqual, testFalse, testGreaterOrEqual, testGreaterThan, testIn, testInstanceOf, testLessOrEqual, testLessThan, testNotEqual, testNotIn, testOccursin, testTrue, timeof, toNegative, toPositive, toPostfixDecr, toPostfixIncr, toPrefixDecr, toPrefixIncr
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ilog.rules.factory.IlrAssignable
getType
 

Field Detail

rulesetVariable

protected boolean rulesetVariable
Constructor Detail

IlrVariable

public IlrVariable(String name,
                   IlrValue value)
Constructs a variable binding.

Parameters:
name - The name of the variable.
value - The value to which the variable is bound.

IlrVariable

public IlrVariable(IlrReflect reflect,
                   String definitionName,
                   Class type)
Constructs a variable binding.

Parameters:
reflect - A reflect.
definitionName - The name of the variable.
type - The type to which the variable is bound.

IlrVariable

public IlrVariable(String definitionName,
                   IlrType type)
Constructs a variable binding.

Parameters:
definitionName - The name of the variable.
type - The type to which the variable is bound.
Method Detail

getName

public String getName()
Gets the name of the variable.

Returns:
The name of the variable.

getShortName

public String getShortName()
Gets the short name of the variable

Returns:
the short name of the variable

setName

public void setName(String name)
Sets the name of the variable.

Parameters:
name - The new name of the variable.

getValue

public IlrValue getValue()
Gets the value of the variable.

Returns:
The value of the variable.

setValue

public void setValue(IlrValue value)
Sets the value of the variable.

Parameters:
value - The new value of the variable.

isAssignableFrom

public boolean isAssignableFrom(IlrValue value)
Checks whether the value value can be assigned to the variable.

Specified by:
isAssignableFrom in interface IlrAssignable
Parameters:
value - The value assigned to the expression.
Returns:
true is the value value can be assigned to the variable, false otherwise.

isEventCondition

public boolean isEventCondition()
Description copied from class: IlrValue
Returns whether this value is, or is bound to, the result of a condition, and this condition is an event condition.

Overrides:
isEventCondition in class IlrValue
Returns:
true if this value is, or is bound to, the result of an event condition, and false otherwise.

exploreValue

public Object exploreValue(IlrFactoryExplorer explorer)
This method explores the variable using a factory explorer.

Specified by:
exploreValue in class IlrValue
Parameters:
explorer - The factory explorer.
Returns:
An object, the result of the exploration, or null if the method does not return a value.

exploreAssignable

public Object exploreAssignable(IlrFactoryExplorer explorer)
This method explores the variable using a factory explorer. In this case, the variable is an assignable object.

Specified by:
exploreAssignable in interface IlrAssignable
Parameters:
explorer - The factory explorer.
Returns:
An object, the result of the exploration, or null if the method does not return a value.

getPackage

public IlrPackageFactory getPackage()
Returns the package in which the variable is defined in case this variable models a package variable. Otherwise it returns null.

Returns:
The package in which the variable is defined.

Rule Execution Server API

© Copyright IBM Corp. 1987, 2012