ilog.rules.dt.model.helper

Class IlrDTVisitHelper

  • java.lang.Object
    • ilog.rules.dt.model.helper.IlrDTVisitHelper


  • public class IlrDTVisitHelper
    extends java.lang.Object
    Visits a DT model in various ways.
    • Method Detail

      • visit

        public static void visit(java.util.Collection collection,
                 IlrDTVisitHelper.CollectionVisitor visitor)
        Visits a collection of elements of an IlrDTModel.
        Parameters:
        collection - The collection to visit.
        visitor - Visitor invoked for each element of the collection.
      • visit

        public static void visit(IlrDTModel dtModel,
                 boolean evenNull,
                 IlrDTVisitHelper.ExpressionHandlerVisitor visitor)
        Visits all expression handlers of an IlrDTModel. Definitions are visited first, then a prefixed traversal method is used to visit partition items and actions of the model.
        Parameters:
        dtModel - The model to be visited.
        evenNull - True to visit expression handlers with a null expression, false to skip empty expression handlers.
        visitor - The visitor invoked for each expression handler.
      • visitDefinitions

        public static void visitDefinitions(IlrDTModel dtModel,
                            IlrDTVisitHelper.DefinitionVisitor visitor)
        Visits all definitions of an IlrDTModel. Partition definitions are visited first, then action definitions. Note: Even if a visit of a partition definition returns false, the visit of the action definition is done.
        Parameters:
        dtModel - The model to be visited.
        visitor - The visitor invoked for each definition.
      • visitDefinitions

        public static boolean visitDefinitions(IlrDTModel dtModel,
                               boolean evenNull,
                               IlrDTVisitHelper.ExpressionHandlerVisitor visitor)
        Visits all definitions of an IlrDTModel. Partition definitions are visited first, then action definitions. Returned values of the visitor are useless.
        Parameters:
        dtModel - The model to be visited.
        evenNull - True to visit definitions with a null expression, false to skip empty definitions.
        visitor - The visitor invoked for each element.
        Returns:
        true if all definitions have been visited and no visitor has returned false
      • visitRelatedElements

        public static void visitRelatedElements(IlrDTDefinition definition,
                                IlrDTVisitHelper.ExpressionHandlerVisitor visitor)
        Visits all expression handlers related to a definition. For a partition definition, all partition items linked to this definition are visited. For an action definition, all actions linked to this definition are visited.
        Parameters:
        definition - The visited definition.
        visitor - The visitor invoked for each element.
      • visitSentenceExpression

        public static boolean visitSentenceExpression(IlrDTExpressionSentence expr,
                                      IlrDTVisitHelper.ExpressionVisitor visitor)
        Deprecated. used visitExpressionDefinition or visitExpressionInstance. Note that holder role are no more represented by expressions.
        This method visits all expressions held by the given expression sentence.
        Parameters:
        expr - the expression sentence to visit
        visitor - the Expression Visitor to be used
        Returns:
        true if all expressions have been visitor and no visitor has returned false
      • visitExpressionDefinition

        public static boolean visitExpressionDefinition(IlrDTExpressionDefinition expr,
                                        IlrDTVisitHelper.ExpressionDefinitionVisitor visitor)
        This method visits all placeholders held by the given expression definition.
        Parameters:
        expr - the expression definition to visit
        visitor - the Expression Visitor to be used
        Returns:
        true if all placeholders have been visited and no visitor has returned false
      • visitExpressionInstance

        public static boolean visitExpressionInstance(IlrDTExpressionInstance expr,
                                      IlrDTVisitHelper.ExpressionInstanceVisitor visitor)
        This method visits all parameters held by the given expression instance.
        Parameters:
        expr - the expression instance to visit
        visitor - the Expression Visitor to be used
        Returns:
        true if all parameters have been visited and no visitor has returned false
      • visitBranch

        public static boolean visitBranch(IlrDTActionSet as,
                          boolean evenNull,
                          IlrDTVisitHelper.ExpressionHandlerVisitor visitor)
        This method visits all expression handlers of the given branch represented by an action set. The branch is visited from the root to the action set through all Partition Item, then to Action of the action set
        Parameters:
        as -
        evenNull -
        visitor -
        Returns:
        true if the whole branch has been visited and no visitor has returned false

© Copyright IBM Corp. 1987, 2017