Gpseq.Collectors
Description:
Various collector implementations.
Content:
Functions:
- public Collector<double?,Object,G> average_double<G> (owned MapFunc<double?,G> mapper)
Returns a collector that produces the arithmetic mean of the given function applied to the elements. If there are no elements, the result is 0.
- public Collector<float?,Object,G> average_float<G> (owned MapFunc<float?,G> mapper)
Returns a collector that produces the arithmetic mean of the given function applied to the elements. If there are no elements, the result is 0.
- public Collector<int64?,Object,G> count<G> ()
Returns a collector that counts the number of elements.
- public Collector<A,Object,G> filter<A,G> (owned Predicate<G> pred, Collector<A,Object,G> downstream)
Returns a collector that only accumulates the elements matching the given predicate.
- public Collector<A,Object,G> fold<A,G> (owned FoldFunc<A,G> accumulator, owned CombineFunc<A> combiner, A identity)
Returns a collector that performs a reduction operation on the elements.
- public Collector<Map<K,List<G>>,Object,G> group_by<K,G> (owned MapFunc<K,G> classifier)
Returns a collector that groups the elements based on the classifier function.
- public Collector<Map<K,V>,Object,G> group_by_with<K,V,G> (owned MapFunc<K,G> classifier, Collector<V,Object,G> downstream)
Returns a collector that groups the elements based on the classifier function, and performs a reduction operation on the values of each key using the downstream collector.
- public Collector<string,Object,string> join (owned string delimiter = "")
Returns a collector that concatenates the elements into a string, in encounter order.
- public Collector<R,Object,G> map<R,A,G> (owned MapFunc<A,G> mapper, Collector<R,Object,A> downstream)
Returns a collector that applies the given mapper function to the elements, and performs a reduction operation on the results using the downstream collector.
- public Collector<Optional<G>,Object,G> max<G> (owned CompareDataFunc<G>? compare = null)
Returns a collector that produces the maximum element based on the given compare function.
- public Collector<Optional<G>,Object,G> min<G> (owned CompareDataFunc<G>? compare = null)
Returns a collector that produces the minimum element based on the given compare function.
- public Collector<Map<bool,List<G>>,Object,G> partition<G> (owned Predicate<G> pred)
Returns a collector that partitions the elements based on the pred function.
- 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.
- public Collector<Optional<G>,Object,G> reduce<G> (owned CombineFunc<G> accumulator)
Returns a collector that performs a reduction operation on the elements.
- public Collector<double?,Object,G> sum_double<G> (owned MapFunc<double?,G> mapper)
Returns a collector that produces the sum of the given function applied to the elements. If there are no elements, the result is 0.
- public Collector<float?,Object,G> sum_float<G> (owned MapFunc<float?,G> mapper)
Returns a collector that produces the sum of the given function applied to the elements. If there are no elements, the result is 0.
- public Collector<int,Object,G> sum_int<G> (owned MapFunc<int,G> mapper)
Returns a collector that produces the sum of the given function applied to the elements. If there are no elements, the result is 0.
- public Collector<int32,Object,G> sum_int32<G> (owned MapFunc<int32,G> mapper)
Returns a collector that produces the sum of the given function applied to the elements. If there are no elements, the result is 0.
- public Collector<int64?,Object,G> sum_int64<G> (owned MapFunc<int64?,G> mapper)
Returns a collector that produces the sum of the given function applied to the elements. If there are no elements, the result is 0.
- public Collector<long,Object,G> sum_long<G> (owned MapFunc<long,G> mapper)
Returns a collector that produces the sum of the given function applied to the elements. If there are no elements, the result is 0.
- public Collector<uint,Object,G> sum_uint<G> (owned MapFunc<uint,G> mapper)
Returns a collector that produces the sum of the given function applied to the elements. If there are no elements, the result is 0.
- public Collector<uint32,Object,G> sum_uint32<G> (owned MapFunc<uint32,G> mapper)
Returns a collector that produces the sum of the given function applied to the elements. If there are no elements, the result is 0.
- public Collector<uint64?,Object,G> sum_uint64<G> (owned MapFunc<uint64?,G> mapper)
Returns a collector that produces the sum of the given function applied to the elements. If there are no elements, the result is 0.
- public Collector<ulong,Object,G> sum_ulong<G> (owned MapFunc<ulong,G> mapper)
Returns a collector that produces the sum of the given function applied to the elements. If there are no elements, the result is 0.
- public Collector<A,Object,G> tee<A,G> (owned Collector<Object,Object,G>[] downstreams, owned TeeMergeFunc<A> merger)
Returns a collector that consists of multiple downstream collectors. The elements are processed by all the downstream collectors, and then their results are merged using the merger function into the final result.
- public Collector<Collection<G>,Object,G> to_collection<G> (Supplier<Collection<G>> factory)
Returns a collector that accumulates the elements into a new collection, in encounter order.
- public Collector<GenericArray<G>,Object,G> to_generic_array<G> ()
Returns a collector that accumulates the elements into a new generic array, in encounter order.
- public Collector<List<G>,Object,G> to_list<G> ()
Returns a collector that accumulates the elements into a new list, in encounter order.
- public Collector<Map<K,V>,Object,G> to_map<K,V,G> (owned MapFunc<K,G> key_mapper, owned MapFunc<V,G> val_mapper, owned CombineFunc<V>? merger = null, owned HashDataFunc<K>? key_hash = null, owned EqualDataFunc<K>? key_equal = null, owned EqualDataFunc<V>? value_equal = null)
Returns a collector that accumulates the elements into a new map.
- public Collector<Set<G>,Object,G> to_set<G> (owned HashDataFunc<G>? hash = null, owned EqualDataFunc<G>? equal = null)
Returns a collector that accumulates the elements into a new set.
- public Collector<Wrapper<A>,Object,G> wrap<A,G> (Collector<A,Object,G> collector)
Returns a collector wrapping the given collector. The returned collector will produce a wrapper object containing the result of the given collector.