Class AggReduce<I,E>
java.lang.Object
org.aksw.commons.collector.core.AggReduce<I,E>
- All Implemented Interfaces:
Serializable, Aggregator<I,E, I>, ParallelAggregator<I, E, I, Accumulator<I, E, I>>
public class AggReduce<I,E>
extends Object
implements ParallelAggregator<I, E, I, Accumulator<I,E,I>>, Serializable
Aggregator whose accumulators apply a reduce operation to their
value and their input to compute their new value.
Accumulators are initialized with a zero element.
Each accumulator obtains its zero element from a supplier which allows
for reduce operations that mutate that element.
Used as a basis for: min, max, sum (which in turn are the basis for e.g. avg)
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAccumulator<I, E, I> combine(Accumulator<I, E, I> a, Accumulator<I, E, I> b) Combine accumulators.Accumulator<I, E, I> booleaninthashCode()Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Aggregator
accumulateAll, accumulateAll, accumulateAll, finishMethods inherited from interface ParallelAggregator
asCollector, asCollector, combineRaw
-
Field Details
-
zeroElementSupplier
-
plusOperator
-
-
Constructor Details
-
AggReduce
-
-
Method Details
-
createAccumulator
- Specified by:
createAccumulatorin interfaceAggregator<I,E, I> - Specified by:
createAccumulatorin interfaceParallelAggregator<I, E, I, Accumulator<I,E, I>>
-
combine
Description copied from interface:ParallelAggregatorCombine accumulators. This method is allowed to mutate any of if its arguments, hence accumulators should be considered exhausted after combination.- Specified by:
combinein interfaceParallelAggregator<I, E, I, Accumulator<I,E, I>> - Parameters:
a- First participant of combinationb- Second participant of combination- Returns:
- Combined accumulator
-
hashCode
-
equals
-