Rule Execution Server API

ilog.rules.factory
Class IlrAsValue

java.lang.Object
  extended by ilog.rules.factory.IlrValue
      extended by ilog.rules.factory.IlrAsValue
All Implemented Interfaces:
Serializable

public final class IlrAsValue
extends IlrValue

This class represents a cast expression of the rule language. A cast transforms a value with a certain type to another value of another type, when the cast is permitted. The cast operation is performed by a IlrUnaryOperator, which is determined using the type of the argument. The method getOperator() returns that operator. If this method returns null, it means that the cast expression is not valid.

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

Constructor Summary
IlrAsValue(Class clazz, IlrValue value)
          Constructs a cast expression.
IlrAsValue(IlrType type, IlrValue value)
          Constructs a cast expression.
 
Method Summary
 Object exploreValue(IlrFactoryExplorer explorer)
          Explores the cast value using a factory explorer and returns an object as a result.
 String getClassName()
          Gets the fully qualified class name for the class to which the cast is made.
 IlrUnaryOperator getOperator()
          Determines and returns the unary operator used to perform the cast.
 String getShortClassName()
          Gets the short class name for the class to which the cast is made.
 IlrValue getValue()
          Gets the value to which the cast is applied.
 boolean isTautology()
          Indicates whether the cast value tries to cast a value to its own type.
 
Methods inherited from class ilog.rules.factory.IlrValue
add, divide, getField, getReflect, getType, getXOMType, invokeEquals, isConstant, isEvent, isEventCondition, 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
 

Constructor Detail

IlrAsValue

public IlrAsValue(Class clazz,
                  IlrValue value)
Constructs a cast expression.

Parameters:
clazz - The class to which the value will be casted.
value - The value to cast.

IlrAsValue

public IlrAsValue(IlrType type,
                  IlrValue value)
Constructs a cast expression. The type to which the expression is casted is a BOM type.

Parameters:
type - The type to which the value is casted.
value - The value to cast.
Method Detail

getValue

public IlrValue getValue()
Gets the value to which the cast is applied.

Returns:
The value to which the cast is applied.

getClassName

public String getClassName()
Gets the fully qualified class name for the class to which the cast is made.

Returns:
The fully qualified class name for the class to which the cast is made.

getShortClassName

public String getShortClassName()
Gets the short class name for the class to which the cast is made.

Returns:
The short class name for the class to which the cast is made.

isTautology

public boolean isTautology()
Indicates whether the cast value tries to cast a value to its own type.

Since:
JRules 6.0
Returns:
true if the type of the arguments is the same as the cast type.

getOperator

public IlrUnaryOperator getOperator()
Determines and returns the unary operator used to perform the cast. This is done using the type of the argument. If this method returns null, the cast expression is not valid.

Returns:
A unary operator, or null if the cast is not valid.

exploreValue

public Object exploreValue(IlrFactoryExplorer explorer)
Explores the cast value using a factory explorer and returns an object as a result.

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

Rule Execution Server API

© Copyright IBM Corp. 1987, 2013