Class AllChildrenMatcher
- java.lang.Object
-
- com.apple.foundationdb.record.query.plan.temp.matchers.AllChildrenMatcher
-
- All Implemented Interfaces:
ExpressionChildrenMatcher
@API(EXPERIMENTAL) public class AllChildrenMatcher extends Object implements ExpressionChildrenMatcher
An expression children matcher that tries to match all children to a singleExpressionMatcher
. Given a singleExpressionMatcher
, this matcher tries to match it to every child. If it matches all of them, it produces a stream of bindings containing the Cartesian product of the streams of bindings from each child, merged usingPlannerBindings.mergedWith(PlannerBindings)
. Because the same matcher is used for all children, the merged bindings will map the single child matcher to a collected list ofBindable
s; such a binding must be retrieved usingPlannerBindings.getAll(ExpressionMatcher)
rather than the usualget()
method.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AllChildrenMatcher
allMatching(ExpressionMatcher<? extends Bindable> childMatcher)
Get a matcher that tries to match all children with the givenExpressionMatcher
.Stream<PlannerBindings>
matches(List<? extends Bindable> children)
Apply this matcher to the children provided by the given iterator and produce a stream of possible bindings.
-
-
-
Method Detail
-
matches
@Nonnull public Stream<PlannerBindings> matches(@Nonnull List<? extends Bindable> children)
Description copied from interface:ExpressionChildrenMatcher
Apply this matcher to the children provided by the given iterator and produce a stream of possible bindings. If the match is not successful, produce an empty stream. Note that this method should not generally match to the children themselves; instead, it should delegate that work to one or more innerExpressionMatcher
s.- Specified by:
matches
in interfaceExpressionChildrenMatcher
- Parameters:
children
- a list of references to the children of a planner expression- Returns:
- a stream of the possible bindings from applying this match to the children in the given iterator
-
allMatching
@Nonnull public static AllChildrenMatcher allMatching(@Nonnull ExpressionMatcher<? extends Bindable> childMatcher)
Get a matcher that tries to match all children with the givenExpressionMatcher
.- Parameters:
childMatcher
- an expression matcher to match all of the children- Returns:
- a matcher that tries to match all children with the given child matcher
-
-