Uses of Interface
com.google.mu.util.stream.BiCollector
Packages that use BiCollector
Package
Description
A convenient CSV parser (requires dot-parse artifact)
Parser combinator that's free from infinite loop or accidental left recursion (requires dot-parse artifact)
BinarySearch and some extra collectors for Guava (requires mug-guava artifact)
Google Protobuf utilities (requires mug-protobuf artifact)
BiStream, BiCollector, MoreStreams, MoreCollectors etc.
- 
Uses of BiCollector in com.google.common.labs.csv
Methods in com.google.common.labs.csv with parameters of type BiCollectorModifier and TypeMethodDescription<R> Stream<R> Csv.parseWithHeaderFields(Reader csv, BiCollector<? super String, ? super String, ? extends R> rowCollector) CSV.parseWithHeaderFields(input, toMap())will parse the non-header rows from theinputreader into a lazy stream ofMap, keyed by the header field names.<R> Stream<R> Csv.parseWithHeaderFields(String csv, BiCollector<? super String, ? super String, ? extends R> rowCollector) CSV.parseWithHeaderFields(input, toMap())will parse the non-header rows in theinputstring into a lazy stream ofMap, keyed by the header field names. - 
Uses of BiCollector in com.google.common.labs.parse
Methods in com.google.common.labs.parse with parameters of type BiCollectorModifier and TypeMethodDescriptionParser.zeroOrMoreDelimited(Parser<A> first, Parser<B>.OrEmpty second, String delimiter, BiCollector<? super A, ? super B, R> collector) Appliesfirstand the optionalsecondpatterns in order, for zero or more times, collecting the results using the providedBiCollector.Parser.zeroOrMoreDelimited(Parser<A> first, Parser<B> second, String delimiter, BiCollector<? super A, ? super B, R> collector) Appliesfirstandsecondpatterns in order, for zero or more times, collecting the results using the providedBiCollector. - 
Uses of BiCollector in com.google.guava.labs.collect
Methods in com.google.guava.labs.collect that return BiCollectorModifier and TypeMethodDescriptionstatic <K,T, V> BiCollector <K, T, ImmutableListMultimap<K, V>> GuavaCollectors.flatteningToImmutableListMultimap(Function<? super T, ? extends Stream<? extends V>> flattener) Returns aBiCollectorthat first flattens each value of the input pair withflattener, and then collects the flattened pairs into anImmutableListMultimap.static <K,T, V> BiCollector <K, T, ImmutableSetMultimap<K, V>> GuavaCollectors.flatteningToImmutableSetMultimap(Function<? super T, ? extends Stream<? extends V>> flattener) Returns aBiCollectorthat first flattens each value of the input pair withflattener, and then collects the flattened pairs into anImmutableSetMultimap.static <K extends Comparable<K>, V>
BiCollector<Range<K>, V, BiStream<Range<K>, Chain<V>>> GuavaCollectors.toDisjointRanges()Returns a BiCollector that merges values mapped to overlapping ranges into aChain, which is an immutableListthat may have been deeplyconcatenated.static <K extends Comparable<K>, V>
BiCollector<Range<K>, V, BiStream<Range<K>, V>> GuavaCollectors.toDisjointRanges(BinaryOperator<V> merger) Returns a BiCollector that merges values mapped to overlapping ranges using themergerfunction and builds aBiStreamwith disjoint ranges and the corresponding merged values.static <K extends Comparable<K>, V, R>
BiCollector<Range<K>, V, BiStream<Range<K>, R>> GuavaCollectors.toDisjointRanges(Collector<V, ?, R> valueCollector) Returns a BiCollector that collects values mapped to overlapping ranges usingvalueCollector, and builds aBiStreamwith disjoint ranges and the corresponding collector results.static <K,V> BiCollector <K, V, ImmutableBiMap<K, V>> GuavaCollectors.toImmutableBiMap()Returns aBiCollectorthat collects the key-value pairs into anImmutableBiMap.static <K,V> BiCollector <K, V, ImmutableListMultimap<K, V>> GuavaCollectors.toImmutableListMultimap()Returns aBiCollectorthat collects the key-value pairs into anImmutableListMultimap.static <K,V> BiCollector <K, V, ImmutableMap<K, V>> GuavaCollectors.toImmutableMap()Returns aBiCollectorthat collects the key-value pairs into anImmutableMap.static <K,V> BiCollector <K, V, ImmutableMap<K, V>> GuavaCollectors.toImmutableMap(BinaryOperator<V> valueMerger) Returns aBiCollectorthat collects the key-value pairs into anImmutableMapusingvalueMergerto merge values of duplicate keys.static <K,V1, V> BiCollector <K, V1, ImmutableMap<K, V>> GuavaCollectors.toImmutableMap(Collector<V1, ?, V> valueCollector) Returns aBiCollectorthat collects the key-value pairs into anImmutableMapusingvalueCollectorto collect values of identical keys into a final value of typeV.static <K,V> BiCollector <K, V, ImmutableMultiset<K>> GuavaCollectors.toImmutableMultiset(ToIntFunction<? super V> countFunction) Returns aBiCollectorthat collects the key-value pairs into anImmutableMultisetwhose elements are the keys, with counts equal to the result of applyingcountFunctionto the values.static <K extends Comparable<K>, V>
BiCollector<Range<K>, V, ImmutableRangeMap<K, V>> GuavaCollectors.toImmutableRangeMap()Returns a BiCollector that takes input (disjoint) ranges and the corresponding values and builds anImmutableRangeMap.static <K extends Comparable<K>, V>
BiCollector<Range<K>, V, ImmutableRangeMap<K, V>> GuavaCollectors.toImmutableRangeMap(BinaryOperator<V> merger) Returns a BiCollector that merges values mapped to overlapping ranges using themergerfunction and builds anImmutableRangeMapwith disjoint ranges and the corresponding merged values.static <K,V> BiCollector <K, V, ImmutableSetMultimap<K, V>> GuavaCollectors.toImmutableSetMultimap()Returns aBiCollectorthat collects the key-value pairs into anImmutableSetMultimap.static <K,V> BiCollector <K, V, ImmutableSortedMap<K, V>> GuavaCollectors.toImmutableSortedMap(Comparator<? super K> comparator) Returns aBiCollectorthat collects the key-value pairs into anImmutableSortedMapaccording tocomparator.static <K,V> BiCollector <K, V, ImmutableSortedMap<K, V>> GuavaCollectors.toImmutableSortedMap(Comparator<? super K> comparator, BinaryOperator<V> valueMerger) Returns aBiCollectorthat collects the key-value pairs into anImmutableSortedMapaccording tocomparator, usingvalueMergerto merge values of duplicate keys.static <R,C, V> BiCollector <R, BiStream<? extends C, ? extends V>, ImmutableTable<R, C, V>> GuavaCollectors.toImmutableTable()Returns aBiCollectorthat collects the key-value pairs into anImmutableTable<R,, where each input key (of typeC, V> R) is mapped to a row in the table, and each input value is aBiStream<C, V>whose keys (of typeC) are mapped to columns in the table, and whose values (of typeV) are mapped to the cell values.static <K, V, M extends Multimap<K,V>> 
BiCollector<K, V, M> GuavaCollectors.toMultimap(Supplier<M> multimapSupplier) Returns aBiCollectorthat collects the key-value pairs into aMultimapcreated withmultimapSupplier.static <K extends Comparable<K>, V, M extends RangeMap<K,V>> 
BiCollector<Range<K>, V, M> GuavaCollectors.toRangeMap(Supplier<? extends M> factory, BinaryOperator<V> merger) Returns a BiCollector that merges values mapped to overlapping ranges using themergerfunction and builds a mutableRangeMapof typeMthat's created byfactory, and populated with disjoint ranges and the corresponding merged values. - 
Uses of BiCollector in com.google.mu.protobuf.util
Methods in com.google.mu.protobuf.util that return BiCollectorModifier and TypeMethodDescriptionstatic BiCollector<CharSequence, com.google.protobuf.Value, com.google.protobuf.Struct> MoreStructs.toStruct()Returns aBiCollectorthat collects the input key-value pairs intoStruct.final BiCollector<CharSequence, Object, com.google.protobuf.Struct> Structor.toStruct()Returns aBiCollectorthat accumulates the name-value pairs into aStructwith the values converted usingStructor.toValue(java.lang.Object). - 
Uses of BiCollector in com.google.mu.util.stream
Methods in com.google.mu.util.stream that return BiCollectorModifier and TypeMethodDescriptionstatic <K,V> BiCollector <K, V, Double> BiCollectors.averagingDouble(ToDoubleBiFunction<? super K, ? super V> mapper) Returns aBiCollectorthat produces the arithmetic mean of a double-valued function applied to the input pair.static <K,V> BiCollector <K, V, Double> BiCollectors.averagingInt(ToIntBiFunction<? super K, ? super V> mapper) Returns aBiCollectorthat produces the arithmetic mean of an integer-valued function applied to the input pair.static <K,V> BiCollector <K, V, Double> BiCollectors.averagingLong(ToLongBiFunction<? super K, ? super V> mapper) Returns aBiCollectorthat produces the arithmetic mean of a long-valued function applied to the input pair.static <K,V, A, B, R> 
BiCollector<K, V, R> BiCollectors.collectingAndThen(BiCollector<K, V, ? extends Both<? extends A, ? extends B>> collector, BiFunction<? super A, ? super B, ? extends R> finisher) static <K,V, T, R> BiCollector <K, V, R> BiCollectors.collectingAndThen(BiCollector<K, V, T> upstream, Function<? super T, ? extends R> finisher) static <K,V, R> BiCollector <K, V, R> BiCollectors.collectingAndThen(Function<? super BiStream<K, V>, ? extends R> finisher) Returns aBiCollectorthat first collects the input pairs into aBiStreamand then appliesfinisheron the intermediary BiStream.static <K,V> BiCollector <K, V, Long> BiCollectors.counting()Returns a countingBiCollectorthat counts the number of input entries.static <K,V> BiCollector <K, V, Integer> BiCollectors.countingDistinct()Returns a countingBiCollectorthat counts the number of distinct input entries according toObject.equals(java.lang.Object)for both keys and values.static <K,V, K1, V1, R> 
BiCollector<K, V, R> BiCollectors.flatMapping(BiFunction<? super K, ? super V, ? extends BiStream<? extends K1, ? extends V1>> flattener, BiCollector<K1, V1, R> downstream) Returns aBiCollectorthat first flattens the input pair usingflattenerand then collects the result pairs usingdownstreamcollector.static <K,V, T, R> BiCollector <K, V, R> BiCollectors.flatMapping(BiFunction<? super K, ? super V, ? extends Stream<? extends T>> flattener, Collector<T, ?, R> downstream) Returns aBiCollectorthat first flattens the input pair usingflattenerand then collects the results usingdownstreamcollector.static <R,C, V> BiCollector <C, V, BiStream<R, BiStream<C, V>>> BiCollectors.groupingBy(BiFunction<? super C, ? super V, ? extends R> classifier) Groups input pairs byclassifierand collects entries belonging to the same group into a nestedBiStream.static <K,V, G, R> BiCollector <K, V, BiStream<G, R>> BiCollectors.groupingBy(BiFunction<? super K, ? super V, ? extends G> classifier, BiCollector<? super K, ? super V, R> groupCollector) Groups input entries byclassifierand collects entries belonging to the same group usinggroupCollector.static <K,V, G> BiCollector <K, V, BiStream<G, V>> BiCollectors.groupingBy(Function<? super K, ? extends G> classifier, BinaryOperator<V> groupReducer) Groups input pairs byclassifierand reduces values belonging to the same group usinggroupReducer.static <K,V, G, R> BiCollector <K, V, BiStream<G, R>> BiCollectors.groupingBy(Function<? super K, ? extends G> classifier, Collector<? super V, ?, R> groupCollector) Groups input entries byclassifierand collects values belonging to the same group usinggroupCollector.static <A,B, R> BiCollector <A, B, R> BiCollectors.inverse(BiCollector<B, A, R> downstream) Returns a BiCollector that inverses the input pairs of(a, b)into(b, a)before passing it todownstreamcollector.static <K,V, K1, V1, R> 
BiCollector<K, V, R> BiCollectors.mapping(BiFunction<? super K, ? super V, ? extends Both<? extends K1, ? extends V1>> mapper, BiCollector<K1, V1, R> downstream) Returns aBiCollectorthat first maps the input pair into another pair usingmapper.static <K,V, K1, V1, R> 
BiCollector<K, V, R> BiCollectors.mapping(BiFunction<? super K, ? super V, ? extends K1> keyMapper, BiFunction<? super K, ? super V, ? extends V1> valueMapper, BiCollector<K1, V1, R> downstream) Returns aBiCollectorthat first maps the input pair usingkeyMapperandvalueMapperrespectively, then collects the results usingdownstreamcollector.static <K,V, T, R> BiCollector <K, V, R> BiCollectors.mapping(BiFunction<? super K, ? super V, ? extends T> mapper, Collector<T, ?, R> downstream) Returns aBiCollectorthat first maps the input pair usingmapperand then collects the results usingdownstreamcollector.static <K,V, K1, V1, R> 
BiCollector<K, V, R> BiCollectors.mapping(Function<? super K, ? extends K1> keyMapper, Function<? super V, ? extends V1> valueMapper, BiCollector<K1, V1, R> downstream) Returns aBiCollectorthat first maps the input pair usingkeyMapperandvalueMapper, then collects the results using thedownstreamcollector.static <K,V> BiCollector <K, V, BiOptional<K, V>> BiCollectors.maxBy(Comparator<? super K> keyComparator, Comparator<? super V> valueComparator) Returns aBiCollectorthat finds the maximum pair according tokeyComparatorand thenvalueComparatorfor equal keys.static <K,V> BiCollector <K, V, BiOptional<K, V>> BiCollectors.maxByKey(Comparator<? super K> comparator) Returns aBiCollectorthat finds the pair with the maximum key according tocomparator.static <K,V> BiCollector <K, V, BiOptional<K, V>> BiCollectors.maxByValue(Comparator<? super V> comparator) Returns aBiCollectorthat finds the pair with the maximum value according tocomparator.static <K,V> BiCollector <K, V, BiOptional<K, V>> BiCollectors.minBy(Comparator<? super K> keyComparator, Comparator<? super V> valueComparator) Returns aBiCollectorthat finds the minimum pair according tokeyComparatorand thenvalueComparatorfor equal keys.static <K,V> BiCollector <K, V, BiOptional<K, V>> BiCollectors.minByKey(Comparator<? super K> comparator) Returns aBiCollectorthat finds the pair with the minimum key according tocomparator.static <K,V> BiCollector <K, V, BiOptional<K, V>> BiCollectors.minByValue(Comparator<? super V> comparator) Returns aBiCollectorthat finds the pair with the minimum value according tocomparator.static <K,V> BiCollector <K, V, Both<BiStream<K, V>, BiStream<K, V>>> BiCollectors.partitioningBy(BiPredicate<? super K, ? super V> predicate) Returns a BiCollector that partitions the incoming pairs into two groups: elements that matchpredicate, and those that don't.static <K,V, R> BiCollector <K, V, Both<R, R>> BiCollectors.partitioningBy(BiPredicate<? super K, ? super V> predicate, BiCollector<? super K, ? super V, ? extends R> downstream) Returns a BiCollector that partitions the incoming pairs into two groups: elements that matchpredicate, and those that don't, and usedownstreamcollector to collect the pairs.static <K,V, T, F> BiCollector <K, V, Both<T, F>> BiCollectors.partitioningBy(BiPredicate<? super K, ? super V> predicate, BiCollector<? super K, ? super V, ? extends T> ifTrue, BiCollector<? super K, ? super V, ? extends F> ifFalse) Returns a BiCollector that partitions the incoming pairs into two groups: elements that matchpredicate, and those that don't, and useifTrueandifFalsedownstream collectors respectively to collect the pairs.static <K,V> BiCollector <K, V, DoubleSummaryStatistics> BiCollectors.summarizingDouble(ToDoubleBiFunction<? super K, ? super V> mapper) Returns aBiCollectorwhich applies andouble-producing mapping function to each input pair, and returns summary statistics for the resulting values.static <K,V> BiCollector <K, V, IntSummaryStatistics> BiCollectors.summarizingInt(ToIntBiFunction<? super K, ? super V> mapper) Returns aBiCollectorwhich applies anint-producing mapping function to each input pair, and returns summary statistics for the resulting values.static <K,V> BiCollector <K, V, LongSummaryStatistics> BiCollectors.summarizingLong(ToLongBiFunction<? super K, ? super V> mapper) Returns aBiCollectorwhich applies anlong-producing mapping function to each input pair, and returns summary statistics for the resulting values.static <K,V> BiCollector <K, V, Double> BiCollectors.summingDouble(ToDoubleBiFunction<? super K, ? super V> mapper) Returns aBiCollectorthat produces the sum of a double-valued function applied to the input pair.static <K,V> BiCollector <K, V, Integer> BiCollectors.summingInt(ToIntBiFunction<? super K, ? super V> mapper) Returns aBiCollectorthat produces the sum of an integer-valued function applied to the input pair.static <K,V> BiCollector <K, V, Long> BiCollectors.summingLong(ToLongBiFunction<? super K, ? super V> mapper) Returns aBiCollectorthat produces the sum of a long-valued function applied to the input pair.static <K,V> BiCollector <K, V, Map<K, V>> BiCollectors.toMap()Returns aBiCollectorthat collects the key-value pairs into an immutableMap.static <K,V> BiCollector <K, V, Map<K, V>> BiCollectors.toMap(BinaryOperator<V> valueMerger) Returns aBiCollectorthat collects the key-value pairs into an immutableMapusingvalueMergerto merge values of duplicate keys.static <K, V, M extends Map<K,V>> 
BiCollector<K, V, M> static <K,V1, V> BiCollector <K, V1, Map<K, V>> Returns aBiCollectorthat collects the key-value pairs into an immutableMapusingvalueCollectorto collect values of identical keys into a final value of typeV.Methods in com.google.mu.util.stream with parameters of type BiCollectorModifier and TypeMethodDescriptionabstract <R> RBiStream.collect(BiCollector<? super K, ? super V, R> collector) Returns an object of typeRthat is the result of collecting the pairs in this stream usingcollector.final <T,R> R BiStream.collect(BiCollector<? super K, ? super V, T> collector, Function<? super T, R> finisher) Equivalent tocollect(collectingAndThen(collector, finisher))but helps to save syntactic noise.static <K,V, A, B, R> 
BiCollector<K, V, R> BiCollectors.collectingAndThen(BiCollector<K, V, ? extends Both<? extends A, ? extends B>> collector, BiFunction<? super A, ? super B, ? extends R> finisher) static <K,V, T, R> BiCollector <K, V, R> BiCollectors.collectingAndThen(BiCollector<K, V, T> upstream, Function<? super T, ? extends R> finisher) static <K,V, K1, V1, R> 
BiCollector<K, V, R> BiCollectors.flatMapping(BiFunction<? super K, ? super V, ? extends BiStream<? extends K1, ? extends V1>> flattener, BiCollector<K1, V1, R> downstream) Returns aBiCollectorthat first flattens the input pair usingflattenerand then collects the result pairs usingdownstreamcollector.static <T,K, V, R> Collector <T, ?, R> MoreCollectors.flatMapping(Function<? super T, ? extends BiStream<? extends K, ? extends V>> flattener, BiCollector<? super K, ? super V, R> downstream) Similar but slightly different thanCollectors.flatMapping(java.util.function.Function<? super T, ? extends java.util.stream.Stream<? extends U>>, java.util.stream.Collector<? super U, A, R>), returns aCollectorthat first flattens the input stream of pairs (as opposed to single elements) and then collects the flattened pairs with thedownstreamBiCollector.MoreCollectors.flatteningMaps(BiCollector<K, V, R> downstream) Returns aCollectorthat flattens the inputMapentries and collects them using thedownstreamBiCollector.final <G,A, R> BiStream <G, R> BiStream.groupConsecutiveBy(BiFunction<? super K, ? super V, ? extends G> classifier, BiCollector<? super K, ? super V, R> groupCollector) Returns aBiStreamconsisting of consecutive groupings from this stream.final <R> Stream<R> BiStream.groupConsecutiveIf(BiStream.Partitioner<? super K, ? super V> sameGroup, BiCollector<? super K, ? super V, R> groupCollector) Returns a lazyStreamof the consecutive groups of values from this stream.static <K,V, G, R> BiCollector <K, V, BiStream<G, R>> BiCollectors.groupingBy(BiFunction<? super K, ? super V, ? extends G> classifier, BiCollector<? super K, ? super V, R> groupCollector) Groups input entries byclassifierand collects entries belonging to the same group usinggroupCollector.static <A,B, R> BiCollector <A, B, R> BiCollectors.inverse(BiCollector<B, A, R> downstream) Returns a BiCollector that inverses the input pairs of(a, b)into(b, a)before passing it todownstreamcollector.static <K,V, K1, V1, R> 
BiCollector<K, V, R> BiCollectors.mapping(BiFunction<? super K, ? super V, ? extends Both<? extends K1, ? extends V1>> mapper, BiCollector<K1, V1, R> downstream) Returns aBiCollectorthat first maps the input pair into another pair usingmapper.static <K,V, K1, V1, R> 
BiCollector<K, V, R> BiCollectors.mapping(BiFunction<? super K, ? super V, ? extends K1> keyMapper, BiFunction<? super K, ? super V, ? extends V1> valueMapper, BiCollector<K1, V1, R> downstream) Returns aBiCollectorthat first maps the input pair usingkeyMapperandvalueMapperrespectively, then collects the results usingdownstreamcollector.static <K,V, K1, V1, R> 
BiCollector<K, V, R> BiCollectors.mapping(Function<? super K, ? extends K1> keyMapper, Function<? super V, ? extends V1> valueMapper, BiCollector<K1, V1, R> downstream) Returns aBiCollectorthat first maps the input pair usingkeyMapperandvalueMapper, then collects the results using thedownstreamcollector.static <T,A, B, R> Collector <T, ?, R> MoreCollectors.mapping(Function<? super T, ? extends Both<? extends A, ? extends B>> mapper, BiCollector<? super A, ? super B, R> downstream) Analogous toCollectors.mapping(), applies a mapping function to each input element before accumulation, except that themapperfunction returns a pair of elements, which are then accumulated by a BiCollector.static <K,V, R> BiCollector <K, V, Both<R, R>> BiCollectors.partitioningBy(BiPredicate<? super K, ? super V> predicate, BiCollector<? super K, ? super V, ? extends R> downstream) Returns a BiCollector that partitions the incoming pairs into two groups: elements that matchpredicate, and those that don't, and usedownstreamcollector to collect the pairs.static <K,V, T, F> BiCollector <K, V, Both<T, F>> BiCollectors.partitioningBy(BiPredicate<? super K, ? super V> predicate, BiCollector<? super K, ? super V, ? extends T> ifTrue, BiCollector<? super K, ? super V, ? extends F> ifFalse) Returns a BiCollector that partitions the incoming pairs into two groups: elements that matchpredicate, and those that don't, and useifTrueandifFalsedownstream collectors respectively to collect the pairs.