partition_with


Description:


public Collector<Map<bool,V>,Object,G> partition_with<V,G> (owned Predicate<G> pred, Collector<V,Object,G> downstream)

Returns a collector that partitions the elements based on the pred function, and performs a reduction operation on the values of each partition using the downstream collector.

The result map always contains mappings for both true and false keys. If a partition has no elements, its value will be obtained from the downstream.create_accumulator and the downstream.finish function applied.

There are no guarantees on the type, mutability, or thread-safety of the returned map.

Parameters:

pred

a predicate function

downstream

a downstream collector

Returns:

the collector implementation


Namespace: Gpseq.Collectors
Package: gpseq-1.0