Interface PlannerProperty<T>

    • Method Detail

      • shouldVisit

        default boolean shouldVisit​(@Nonnull
                                    RelationalExpression expression)
        Return whether the property should visit the subgraph rooted at the given expression. Called on nodes in the expression graph in visit pre-order of the depth-first traversal of the graph. That is, as each node is visited for the first time, shouldVisit() is called on that node. If shouldVisit() returns false, then evaluateAtExpression(RelationalExpression, List) will not be called on the given expression.
        Parameters:
        expression - the planner expression to visit
        Returns:
        true if the children of expression should be visited and false if they should not be visited
      • shouldVisit

        default boolean shouldVisit​(@Nonnull
                                    ExpressionRef<? extends RelationalExpression> ref)
        Return whether the property should visit the given reference and, transitively, the members of the reference. Called on expression references in the graph in visit pre-order of the depth-first traversal of the graph. That is, as a reference is visited, shouldVisit() is called on that reference. If shouldVisit() returns false, then evaluateAtRef(ExpressionRef, List) will not be called on the given reference.
        Parameters:
        ref - the expression reference to visit
        Returns:
        true if the members of ref should be visited and false if they should not be visited
      • shouldVisit

        default boolean shouldVisit​(@Nonnull
                                    Quantifier quantifier)
        Return whether the property should visit the given quantifier and the references that the quantifier ranges over. Called on quantifiers in the graph in visit pre-order of the depth-first traversal of the graph. That is, as a quantifier is visited, shouldVisit() is called on that quantifier. If shouldVisit() returns false, then evaluateAtQuantifier(Quantifier, Object) will not be called on the given quantifier.
        Parameters:
        quantifier - the quantifier to visit
        Returns:
        true if the expression reference quantifier ranges over should be visited and false if it should not be visited
      • evaluateAtExpression

        @Nonnull
        T evaluateAtExpression​(@Nonnull
                               RelationalExpression expression,
                               @Nonnull
                               List<T> childResults)
        Evaluate the property at the given expression, using the results of evaluating the property at its children. Called on nodes in the graph in visit post-order of the depth-first traversal of the graph. That is, as each expression is visited (after all of its children have been visited, if applicable), evaluateAtExpression() is called on that expression.
        Parameters:
        expression - the cursor to visit
        childResults - the results of the property evaluated at the children of expression
        Returns:
        the value of property at the given expression
      • evaluateAtRef

        @Nonnull
        T evaluateAtRef​(@Nonnull
                        ExpressionRef<? extends RelationalExpression> ref,
                        @Nonnull
                        List<T> memberResults)
        Evaluate the property at the given reference, using the results of evaluating the property at its members. Called on nodes in the graph in visit post-order of the depth-first traversal of the graph. That is, as each reference is visited (after all of its members have been visited, if applicable), evaluateAtRef() is called on that reference.
        Parameters:
        ref - the expression reference to visit
        memberResults - the results of the property evaluated at the members of ref
        Returns:
        the value of property at the given reference
      • evaluateAtQuantifier

        @Nonnull
        default T evaluateAtQuantifier​(@Nonnull
                                       Quantifier quantifier,
                                       @Nullable
                                       T rangesOverResult)
        Evaluate the property at the given quantifier, using the result of evaluating the property at the reference the quantifier ranges over. Called on quantifiers in the graph in visit post-order of the depth-first traversal of the graph. That is, as each quantifier is visited (after the expression reference it ranges over has been visited, if applicable), evaluateAtQuantifier() is called on that quantifier.
        Parameters:
        quantifier - the quantifier to visit
        rangesOverResult - the result of the property evaluated at the ExpressionRef quantifier ranges over
        Returns:
        the value of property at the given quantifier