Rule Execution Server API

ilog.rules.factory
Interface IlrBinaryOperator

All Superinterfaces:
Serializable

public interface IlrBinaryOperator
extends Serializable

This interface represents a binary arithmetic operation performed by some classes of the rule factory API. A binary operation takes two objects as input and returns an object as the result. The type of the result is inferred from the types of the arguments. Internally when an object of the factory API involving a binary operation is created, a binary operator is determined and attached to that object. The evaluate method can be used to perform the binary operation.

See Also:
IlrBinaryValue

Field Summary
static int ADD
          This integer constant represents an addition.
static int DIVIDE
          This integer constant represents a division.
static int MAX
          This integer constant represents a maximum.
static int MIN
          This integer constant represents a minimum.
static int MULTIPLY
          This integer constant represents a multiplication.
static int REMAINDER
          This integer constant represents the remainder of a division.
static int SUBTRACT
          This integer constant represents a subtraction.
 
Method Summary
 Object evaluate(Object arg1, Object arg2)
          Performs the binary operation.
 int getKind()
          Gets the kind of the binary operation.
 Class getResultType()
          Gets the result type of the binary operation.
 

Field Detail

ADD

static final int ADD
This integer constant represents an addition.

See Also:
Constant Field Values

SUBTRACT

static final int SUBTRACT
This integer constant represents a subtraction.

See Also:
Constant Field Values

MULTIPLY

static final int MULTIPLY
This integer constant represents a multiplication.

See Also:
Constant Field Values

DIVIDE

static final int DIVIDE
This integer constant represents a division.

See Also:
Constant Field Values

REMAINDER

static final int REMAINDER
This integer constant represents the remainder of a division.

See Also:
Constant Field Values

MAX

static final int MAX
This integer constant represents a maximum.

See Also:
Constant Field Values

MIN

static final int MIN
This integer constant represents a minimum.

See Also:
Constant Field Values
Method Detail

getResultType

Class getResultType()
Gets the result type of the binary operation.

Returns:
The result type of the binary operation. The returned type is never null.

getKind

int getKind()
Gets the kind of the binary operation. The kind of the operation is defined by the integer constants of this interface.

Returns:
The kind of the binary operation.

evaluate

Object evaluate(Object arg1,
                Object arg2)
Performs the binary operation. The binary operation takes two objects as parameters and returns an object as result. If the arguments are of primitive types, they should be wrapped using their respective wrapping class to use this method. If the result is a primitive type, it is also wrapped using the corresponding wrapping type.

Parameters:
arg1 - The first argument of the operation.
arg2 - The second argument of the operation.
Returns:
An object, the result of the binary operation.

Rule Execution Server API

© Copyright IBM Corp. 1987, 2013