Class MultiChildrenMatcher
- java.lang.Object
-
- com.apple.foundationdb.record.query.plan.temp.matchers.MultiChildrenMatcher
-
- All Implemented Interfaces:
ExpressionChildrenMatcher
- Direct Known Subclasses:
MultiChildrenMatcher.AllChildrenMatcher
,MultiChildrenMatcher.SomeChildrenMatcher
@API(EXPERIMENTAL) public abstract class MultiChildrenMatcher extends Object implements ExpressionChildrenMatcher
An expression children matcher that tries to match a multitude of children to a singleExpressionMatcher
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MultiChildrenMatcher.AllChildrenMatcher
An expression children matcher that tries to match all children to a singleExpressionMatcher
.static class
MultiChildrenMatcher.SomeChildrenMatcher
An expression children matcher that tries to match some children to a singleExpressionMatcher
.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static MultiChildrenMatcher
allMatching(ExpressionMatcher<? extends Bindable> childMatcher)
Get a matcher that tries to match all children with the givenExpressionMatcher
.Stream<PlannerBindings>
matches(PlannerBindings outerBindings, List<? extends Bindable> children)
Apply this matcher to the children provided by the given iterator and produce a stream of possible bindings.protected abstract Optional<Stream<PlannerBindings>>
onEmptyIndividualBindings(Stream<PlannerBindings> accumulatedStream)
static MultiChildrenMatcher
someMatching(ExpressionMatcher<? extends Bindable> childMatcher)
Get a matcher that tries to match some children with the givenExpressionMatcher
.
-
-
-
Method Detail
-
matches
@Nonnull public Stream<PlannerBindings> matches(@Nonnull PlannerBindings outerBindings, @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:
outerBindings
- preexisting bindings supplied by the callerchildren
- 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
-
onEmptyIndividualBindings
@Nonnull protected abstract Optional<Stream<PlannerBindings>> onEmptyIndividualBindings(@Nonnull Stream<PlannerBindings> accumulatedStream)
-
allMatching
@Nonnull public static MultiChildrenMatcher 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
-
someMatching
@Nonnull public static MultiChildrenMatcher someMatching(@Nonnull ExpressionMatcher<? extends Bindable> childMatcher)
Get a matcher that tries to match some children with the givenExpressionMatcher
.- Parameters:
childMatcher
- an expression matcher to match all of the children- Returns:
- a matcher that tries to match some children with the given child matcher
-
-