Interface ExpressionMatcher<T extends Bindable>

    • Method Detail

      • getRootClass

        @Nonnull
        Class<? extends Bindable> getRootClass()
        Get a class or interface extending RelationalExpression that is a super class of every planner expression that this matcher can match. Ideally, it should be the lowest such class but it may not be. A planner will generally use this method to quickly determine a set of rules that could match an expression, without considering each rule and trying to apply it. A good implementation of this method helps the planner match rules efficiently.
        Returns:
        a class object for a class that is a super class of every planner expression this matcher can match
      • matchWith

        @Nonnull
        Stream<PlannerBindings> matchWith​(@Nonnull
                                          PlannerBindings outerBindings,
                                          @Nonnull
                                          ExpressionRef<? extends RelationalExpression> ref,
                                          @Nonnull
                                          List<? extends Bindable> children)
        Attempt to match this matcher against the given expression reference. Note that implementations of matchWith() should only attempt to match the given root with this planner expression or attempt to access the members of the given reference.
        Parameters:
        outerBindings - preexisting bindings to be used by the matcher
        ref - a reference to match with
        children - the conceptual children of ref, i.e. the memmbers of the group reference.
        Returns:
        a stream of PlannerBindings containing the matched bindings, or an empty stream is no match was found
      • matchWith

        @Nonnull
        Stream<PlannerBindings> matchWith​(@Nonnull
                                          PlannerBindings outerBindings,
                                          @Nonnull
                                          QueryPredicate predicate,
                                          @Nonnull
                                          List<? extends Bindable> children)
        Attempt to match this matcher against the given QueryPredicate. Note that implementations of matchWith() should only attempt to match the given root with this planner expression.
        Parameters:
        outerBindings - preexisting bindings to be used by the matcher
        predicate - a predicate to match with
        children - the conceptual children of predicate
        Returns:
        a stream of PlannerBindings containing the matched bindings, or an empty stream is no match was found
      • matchWith

        @Nonnull
        Stream<PlannerBindings> matchWith​(@Nonnull
                                          PlannerBindings outerBindings,
                                          @Nonnull
                                          Quantifier quantifier,
                                          @Nonnull
                                          List<? extends Bindable> children)
        Attempt to match this matcher against the given Quantifier. Note that implementations of matchWith() should only attempt to match the given root with this planner expression.
        Parameters:
        outerBindings - preexisting bindings to be used by the matcher
        quantifier - a quantifier to match with
        children - the conceptual children of quantifier
        Returns:
        a stream of PlannerBindings containing the matched bindings, or an empty stream is no match was found
      • matchWith

        @Nonnull
        Stream<PlannerBindings> matchWith​(@Nonnull
                                          PlannerBindings outerBindings,
                                          @Nonnull
                                          PartialMatch partialMatch,
                                          @Nonnull
                                          List<? extends Bindable> children)
        Attempt to match this matcher against the given PartialMatch. Note that implementations of matchWith() should only attempt to match the given root with this planner expression.
        Parameters:
        outerBindings - preexisting bindings to be used by the matcher
        partialMatch - a partial match to match with
        children - the conceptual children of predicate
        Returns:
        a stream of PlannerBindings containing the matched bindings, or an empty stream is no match was found
      • matchWith

        @Nonnull
        Stream<PlannerBindings> matchWith​(@Nonnull
                                          PlannerBindings outerBindings,
                                          @Nonnull
                                          MatchPartition matchPartition,
                                          @Nonnull
                                          List<? extends Bindable> children)
        Attempt to match this matcher against the given MatchPartition. Note that implementations of matchWith() should only attempt to match the given root with this planner expression.
        Parameters:
        outerBindings - preexisting bindings to be used by the matcher
        matchPartition - to match with
        children - the conceptual children of predicate
        Returns:
        a stream of PlannerBindings containing the matched bindings, or an empty stream is no match was found