public class NumberSumLoader extends SingleDependencyReducingAggregateLoader<Number>
myDependency
mySpec
Constructor and Description |
---|
NumberSumLoader(AttributeSpec<Number> spec,
AttributeSpec<Number> dependency) |
Modifier and Type | Method and Description |
---|---|
Number |
merge(Supplier<Number> self,
List<Number> list)
Calculates reduction of tree node where
self is value of the current row and list represents values passed from children (it
may be or be not values of children rows depending on strategy type). |
Number |
merge(Supplier<Number> self,
Supplier<Number> reduced)
Calculates reduction of tree node where
self is value of the current row, and reduced is result of flat reduction. |
Number |
reduce(List<Number> list)
Reduces the list of values to one value.
|
getAttributeDependencies, getSelfValue
loadValue
firstChildError
getAttributeSpec, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
convert
getCachingStrategy
isWholeForestDependent, preload
getAttributeSpec, getContextDependencies, getGlobalTrail
public NumberSumLoader(AttributeSpec<Number> spec, AttributeSpec<Number> dependency)
public Number reduce(@NotNull List<Number> list)
ValueReducer
merge
methods if not overridden. Can be called from convert
methodlist
- list of values, every item can be nullpublic Number merge(@NotNull Supplier<Number> self, @NotNull Supplier<Number> reduced)
ValueReducer
self
is value of the current row, and reduced
is result of flat reduction. Value
modifications can be done here if one wants to build reduction that computes value based on depth in the structure. Called from strict subtree
reduction strategy or from other merge
method if not optimized.public Number merge(Supplier<Number> self, List<Number> list)
ValueReducer
self
is value of the current row and list
represents values passed from children (it
may be or be not values of children rows depending on strategy type). Value modifications can be done here if one wants to build reduction
that computes value based on depth in the structure. Called from full subtree reduction strategy, that is default and the most frequently
used strategy for most reducing aggregates (it makes this method the most probable target for optimization).Copyright © 2024 Tempo Software. All Rights Reserved.