ilog.rules.factory

Interface IlrBinaryOperator

  • All Superinterfaces:
    java.io.Serializable


    public interface IlrBinaryOperator
    extends java.io.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

      Fields 
      Modifier and Type Field and Description
      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

      Methods 
      Modifier and Type Method and Description
      java.lang.Object evaluate(java.lang.Object arg1, java.lang.Object arg2)
      Performs the binary operation.
      int getKind()
      Gets the kind of the binary operation.
      java.lang.Class getResultType()
      Gets the result type of the binary operation.
    • Field Detail

      • 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
    • Method Detail

      • getResultType

        java.lang.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

        java.lang.Object evaluate(java.lang.Object arg1,
                                java.lang.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.

© Copyright IBM Corp. 1987, 2017