public static class ReductionStrategy.SubtreeReductionStrategy<T> extends ReductionStrategy.AbstractReductionStrategy<T>
Main value: the aggregation based only on all children.
Additional data: none.
ReductionStrategy.AbstractReductionStrategy<T>, ReductionStrategy.ChildrenReductionStrategy<T>, ReductionStrategy.LeavesReductionStrategy<T>, ReductionStrategy.StrictReductionStrategy<T>, ReductionStrategy.SubtreeReductionStrategy<T>
Constructor and Description |
---|
SubtreeReductionStrategy() |
Modifier and Type | Method and Description |
---|---|
AttributeValue<T> |
apply(Supplier<AttributeValue<T>> selfSupplier,
List<AttributeValue<T>> children,
ValueReducer<T> reducer)
Reduce value of the current node and children values to the single value using the specified
ValueReducer . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forAttributeSpec, forStrategyType, getStrategyType
@NotNull public AttributeValue<T> apply(@NotNull Supplier<AttributeValue<T>> selfSupplier, @NotNull List<AttributeValue<T>> children, @NotNull ValueReducer<T> reducer)
ReductionStrategy
ValueReducer
.
This method is designed to be used from AttributeLoader.Aggregate
.
Reduction can be performed over any subtree and it's assumed that every ReductionStrategy
describes in this method a reduction for a single known subtree type.selfSupplier
- supplier for value of current row. Supplier can be or be not called from this method depending on type of subtree
this strategy describes. It's assumed that calling supplier can be heavy operation so it shouldn't be called more than once for each row from
this method.children
- values of direct children rows supplied by AttributeLoader.Aggregate.loadValue
reducer
- instance that is responsible for reducing but can ignore actual form of handled subtreeCopyright © 2024 Tempo Software. All Rights Reserved.