CollectorI
A Collector accumulates information from elements coming from some data source, usually a kotlinx.coroutines.flow.Flow or Iterable.
The accumulation is done in three phases:
Initialization of some (mutable) accumulator (supply)
Updating the accumulator with each value (accumulate)
Finalize the work, and extract the final result (finish)
This interface is heavily influenced by Java's Collector
and Haskell's foldl
library.
Inheritors
Functions
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Combines two Collectors by performing the phases of each of them in parallel.
open fun <B, S, V> zip(other: CollectorI<B, Value, S>, combine: suspend (Result, S) -> V): Collector<Value, V>
Combines two Collectors by performing the phases of each of them in parallel, and then combining the end result in a final step.