Package one.util.streamex
Interface MergingCollector<T,A,R>
-
- Type Parameters:
T
- the type of input elements to the reduction operationA
- the mutable accumulation type of the reduction operation (often hidden as an implementation detail)R
- the result type of the reduction operation
- All Superinterfaces:
java.util.stream.Collector<T,A,R>
- All Known Subinterfaces:
DoubleCollector<A,R>
,IntCollector<A,R>
,LongCollector<A,R>
- All Known Implementing Classes:
Internals.BaseCollector
,Internals.DoubleCollectorImpl
,Internals.IntCollectorImpl
,Internals.LongCollectorImpl
,Internals.PartialCollector
interface MergingCollector<T,A,R> extends java.util.stream.Collector<T,A,R>
AMergingCollector
is aCollector
with more specific combining algorithm. Instead of providing a combiner which can create new partial result theMergingCollector
must provide a merger which merges the second partial result into the first one.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default java.util.function.BinaryOperator<A>
combiner()
A function that accepts two partial results and combines them returning either existing partial result or new one.java.util.function.BiConsumer<A,A>
merger()
A function that merges the second partial result into the first partial result.
-
-
-
Method Detail
-
merger
java.util.function.BiConsumer<A,A> merger()
A function that merges the second partial result into the first partial result.- Returns:
- a function that merges the second partial result into the first partial result.
-
-