T
- the type of planner expression that is contained in this reference@API(value=EXPERIMENTAL) public class FixedCollectionExpressionRef<T extends PlannerExpression> extends Object implements ExpressionRef<T>
A FixedCollectionExpressionRef
is a reference that contains more than one member. Unlike a full
Cascades-style group reference, the number of members is fixed at the time of creation. Furthermore, each member
is a fixed SingleExpressionRef
. As a result, the only modifications permitted within the reference are
substitutions of one member for another member within the same SingleExpressionRef
. These limited semantics
can be handled by a rewrite planner without major modifications or the complexity of a full Cascades-style planner.
Note that the FixedCollectionExpressionRef
does not do any kind of memoization. Care should be taken to
minimize the number of members of the group to avoid using too much memory.
ExpressionRef.UngettableReferenceException
Constructor and Description |
---|
FixedCollectionExpressionRef(Collection<T> expressions) |
Modifier and Type | Method and Description |
---|---|
<U> U |
acceptPropertyVisitor(PlannerProperty<U> property) |
Stream<PlannerBindings> |
bindWithin(ExpressionMatcher<? extends Bindable> matcher)
Try to bind the given matcher to the members of this reference.
|
T |
get()
Return the expression contained in this reference.
|
List<SingleExpressionRef<T>> |
getMembers() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
bindTo
public FixedCollectionExpressionRef(@Nonnull Collection<T> expressions)
@Nonnull public T get()
ExpressionRef
get
in interface ExpressionRef<T extends PlannerExpression>
@Nonnull public List<SingleExpressionRef<T>> getMembers()
public <U> U acceptPropertyVisitor(@Nonnull PlannerProperty<U> property)
acceptPropertyVisitor
in interface ExpressionRef<T extends PlannerExpression>
@Nonnull public Stream<PlannerBindings> bindWithin(@Nonnull ExpressionMatcher<? extends Bindable> matcher)
ExpressionRef
Stream
API, so as to minimize unnecessary
work.bindWithin
in interface ExpressionRef<T extends PlannerExpression>
matcher
- an expression matcher to match the member(s) of this reference with