Class ExpressionMatcher.DefaultMatcher<T extends Bindable>
- java.lang.Object
-
- com.apple.foundationdb.record.query.plan.temp.matchers.ExpressionMatcher.DefaultMatcher<T>
-
- Type Parameters:
T
- a sub class ofBindable
- All Implemented Interfaces:
ExpressionMatcher<T>
- Direct Known Subclasses:
ReferenceMatcher
- Enclosing interface:
- ExpressionMatcher<T extends Bindable>
public static class ExpressionMatcher.DefaultMatcher<T extends Bindable> extends Object implements ExpressionMatcher<T>
A default matcher. Matches nothing! This class is meant to serve as a super class for simple implementations.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.apple.foundationdb.record.query.plan.temp.matchers.ExpressionMatcher
ExpressionMatcher.DefaultMatcher<T extends Bindable>
-
-
Constructor Summary
Constructors Constructor Description DefaultMatcher()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Class<? extends Bindable>
getRootClass()
Get a class or interface extendingRelationalExpression
that is a super class of every planner expression that this matcher can match.Stream<PlannerBindings>
matchWith(PlannerBindings outerBindings, ExpressionRef<? extends RelationalExpression> ref, List<? extends Bindable> children)
Attempt to match this matcher against the given expression reference.Stream<PlannerBindings>
matchWith(PlannerBindings outerBindings, MatchPartition matchPartition, List<? extends Bindable> children)
Attempt to match this matcher against the givenMatchPartition
.Stream<PlannerBindings>
matchWith(PlannerBindings outerBindings, PartialMatch partialMatch, List<? extends Bindable> children)
Attempt to match this matcher against the givenPartialMatch
.Stream<PlannerBindings>
matchWith(PlannerBindings outerBindings, Quantifier quantifier, List<? extends Bindable> children)
Attempt to match this matcher against the givenQuantifier
.Stream<PlannerBindings>
matchWith(PlannerBindings outerBindings, RelationalExpression expression, List<? extends Bindable> children)
Attempt to match this matcher against the givenExpressionMatcher
.Stream<PlannerBindings>
matchWith(PlannerBindings outerBindings, QueryPredicate predicate, List<? extends Bindable> children)
Attempt to match this matcher against the givenQueryPredicate
.
-
-
-
Method Detail
-
getRootClass
@Nonnull public Class<? extends Bindable> getRootClass()
Description copied from interface:ExpressionMatcher
Get a class or interface extendingRelationalExpression
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.- Specified by:
getRootClass
in interfaceExpressionMatcher<T extends Bindable>
- Returns:
- a class object for a class that is a super class of every planner expression this matcher can match
-
matchWith
@Nonnull public Stream<PlannerBindings> matchWith(@Nonnull PlannerBindings outerBindings, @Nonnull ExpressionRef<? extends RelationalExpression> ref, @Nonnull List<? extends Bindable> children)
Description copied from interface:ExpressionMatcher
Attempt to match this matcher against the given expression reference. Note that implementations ofmatchWith()
should only attempt to match the given root with this planner expression or attempt to access the members of the given reference.- Specified by:
matchWith
in interfaceExpressionMatcher<T extends Bindable>
- Parameters:
outerBindings
- preexisting bindings to be used by the matcherref
- a reference to match withchildren
- the conceptual children ofref
, 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 public Stream<PlannerBindings> matchWith(@Nonnull PlannerBindings outerBindings, @Nonnull RelationalExpression expression, @Nonnull List<? extends Bindable> children)
Description copied from interface:ExpressionMatcher
Attempt to match this matcher against the givenExpressionMatcher
. Note that implementations ofmatchWith()
should only attempt to match the given root with this planner expression.- Specified by:
matchWith
in interfaceExpressionMatcher<T extends Bindable>
- Parameters:
outerBindings
- preexisting bindings to be used by the matcherexpression
- a planner expression to match withchildren
- the conceptual children ofexpression
- Returns:
- a stream of
PlannerBindings
containing the matched bindings, or an empty stream is no match was found
-
matchWith
@Nonnull public Stream<PlannerBindings> matchWith(@Nonnull PlannerBindings outerBindings, @Nonnull QueryPredicate predicate, @Nonnull List<? extends Bindable> children)
Description copied from interface:ExpressionMatcher
Attempt to match this matcher against the givenQueryPredicate
. Note that implementations ofmatchWith()
should only attempt to match the given root with this planner expression.- Specified by:
matchWith
in interfaceExpressionMatcher<T extends Bindable>
- Parameters:
outerBindings
- preexisting bindings to be used by the matcherpredicate
- a predicate to match withchildren
- the conceptual children ofpredicate
- Returns:
- a stream of
PlannerBindings
containing the matched bindings, or an empty stream is no match was found
-
matchWith
@Nonnull public Stream<PlannerBindings> matchWith(@Nonnull PlannerBindings outerBindings, @Nonnull Quantifier quantifier, @Nonnull List<? extends Bindable> children)
Description copied from interface:ExpressionMatcher
Attempt to match this matcher against the givenQuantifier
. Note that implementations ofmatchWith()
should only attempt to match the given root with this planner expression.- Specified by:
matchWith
in interfaceExpressionMatcher<T extends Bindable>
- Parameters:
outerBindings
- preexisting bindings to be used by the matcherquantifier
- a quantifier to match withchildren
- the conceptual children ofquantifier
- Returns:
- a stream of
PlannerBindings
containing the matched bindings, or an empty stream is no match was found
-
matchWith
@Nonnull public Stream<PlannerBindings> matchWith(@Nonnull PlannerBindings outerBindings, @Nonnull PartialMatch partialMatch, @Nonnull List<? extends Bindable> children)
Description copied from interface:ExpressionMatcher
Attempt to match this matcher against the givenPartialMatch
. Note that implementations ofmatchWith()
should only attempt to match the given root with this planner expression.- Specified by:
matchWith
in interfaceExpressionMatcher<T extends Bindable>
- Parameters:
outerBindings
- preexisting bindings to be used by the matcherpartialMatch
- a partial match to match withchildren
- the conceptual children ofpredicate
- Returns:
- a stream of
PlannerBindings
containing the matched bindings, or an empty stream is no match was found
-
matchWith
@Nonnull public Stream<PlannerBindings> matchWith(@Nonnull PlannerBindings outerBindings, @Nonnull MatchPartition matchPartition, @Nonnull List<? extends Bindable> children)
Description copied from interface:ExpressionMatcher
Attempt to match this matcher against the givenMatchPartition
. Note that implementations ofmatchWith()
should only attempt to match the given root with this planner expression.- Specified by:
matchWith
in interfaceExpressionMatcher<T extends Bindable>
- Parameters:
outerBindings
- preexisting bindings to be used by the matchermatchPartition
- to match withchildren
- the conceptual children ofpredicate
- Returns:
- a stream of
PlannerBindings
containing the matched bindings, or an empty stream is no match was found
-
-