ilog.rules.brl.translation

Class IlrStatementHelper

  • java.lang.Object
    • ilog.rules.brl.translation.IlrStatementHelper


  • public final class IlrStatementHelper
    extends java.lang.Object
    This helper class provides static utilities to manipulate statements.
    • Method Detail

      • getBinding

        public static IlrSimpleBindingStatement getBinding(IlrRuleStatement rule,
                                           java.lang.String varName)
        Searches the binding named name in the list of variables used in a rule statement.
        Parameters:
        rule - The rule statement.
        varName - The name of the variable to look for.
        Returns:
        The instance of IlrSimpleBindingStatement or null.
      • getBinding

        public static IlrSimpleBindingStatement getBinding(IlrRuleStatement rule,
                                           IlrConcept concept)
        Searches the first binding of the specified rule, which binds an object with a concept concept.
        Parameters:
        rule - The rule statement.
        concept - The concept.
        Returns:
        The instance of IlrSimpleBindingStatement or null.
      • getPreviousBinding

        public static IlrSimpleBindingStatement getPreviousBinding(IlrRuleStatement rule,
                                                   IlrConditionStatement from,
                                                   IlrConcept concept)
        Searches the last binding of the specified rule, which binds an object with a concept concept.
        Parameters:
        rule - The rule statement.
        concept - The concept.
        Returns:
        The instance of IlrSimpleBindingStatement or null.
      • getBinding

        public static IlrSimpleBindingStatement getBinding(IlrRuleStatement rule,
                                           IlrSyntaxTree.Node node)
        Searches the binding corresponding to the specified syntax tree node.
        Parameters:
        rule - The rule statement.
        node - The syntax tree node to look for.
        Returns:
        The variable named name or null if not found.
      • getUpdateContext

        public static IlrSimpleActionStatement getUpdateContext(IlrRuleStatement rule,
                                                boolean inActions)
        Gets the update context statement, if any.
        Parameters:
        rule - The rule.
        inActions - if true, look in 'actions'. Look in 'else actions' otherwise.
        Returns:
        The simple action statement found.
      • getUpdate

        public static IlrSimpleActionStatement getUpdate(IlrRuleStatement rule,
                                         java.lang.String varName,
                                         boolean inActions)
        Gets the update statement with the specified name, if any.
        Parameters:
        varName -
        inActions - If true, look in 'actions'. Look in 'else actions' otherwise.
      • hasElsePart

        public static boolean hasElsePart(IlrRuleStatement rule)
        Tests if a rule statement has an else part.
        Returns:
        true if the provided rule statement contains else-actions.
      • getNamedStatement

        public static IlrNamedStatement getNamedStatement(IlrRuleStatement rule,
                                          java.lang.String name)
        Gets the named statement with name name.
        Parameters:
        rule - The rule statement from which to retrieve the named statement.
        name - The name of the named statement.
        Returns:
        The named statement found, or null.

© Copyright IBM Corp. 1987, 2017