Class ReducingAggregateLoader<T>
- Type Parameters:
T- type of reduced values
- All Implemented Interfaces:
AggregateAttributeLoader<T>,AttributeLoader<T>,MultiRowAttributeLoader<T>,ValueReducer<T>,RowAttributeLoader<T>
- Direct Known Subclasses:
SingleDependencyReducingAggregateLoader
A base class for aggregate loaders that calculate values using only the specified part of subtree.
The part of subtree to use is defined by ReductionStrategy, which is specified by type parameter in
the attribute specification.
Here and in other classes, the process of combining the current value with values calculated for partial subtree into one value is called reduction.
This class:- checks for errors,
- filters out values for generator rows,
- passes values to the reduction strategy.
- See Also:
-
Field Summary
Fields inherited from class AbstractAttributeLoader
mySpec -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract AttributeValue<T>getSelfValue(AggregateAttributeContext context) loadValue(List<AttributeValue<T>> childrenValues, AggregateAttributeContext context) Performs aggregate loading.Methods inherited from class AbstractAggregateLoader
firstChildErrorMethods inherited from class AbstractAttributeLoader
getAttributeSpec, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface AttributeLoader
getAttributeDependencies, getAttributeSpec, getContextDependencies, getGlobalTrailMethods inherited from interface MultiRowAttributeLoader
getCachingStrategyMethods inherited from interface RowAttributeLoader
isWholeForestDependent, preloadMethods inherited from interface ValueReducer
convert, merge, merge, reduce
-
Constructor Details
-
ReducingAggregateLoader
-
-
Method Details
-
loadValue
public AttributeValue<T> loadValue(List<AttributeValue<T>> childrenValues, AggregateAttributeContext context) Description copied from interface:AggregateAttributeLoaderPerforms aggregate loading.
If the value is missing or empty, the loader should return
AttributeValue.undefined(). If for some reason this loader is not applicable for the given row, it should returnnull. (Note, however, that if multiple aggregate loaders work on the same attribute, it could be tricky and lead to unexpected results.)Note: children values may contain loop markers
- Specified by:
loadValuein interfaceAggregateAttributeLoader<T>- Parameters:
childrenValues- the values of this attribute for all children rows, in the same order as the children rowscontext- loading context- Returns:
- the calculated value
-
getSelfValue
-