Uses of Class
com.google.mu.util.stream.BiStream
Packages that use BiStream
Package
Description
BinarySearch and some extra collectors for Guava (requires mug-guava artifact)
A few useful collections
StringFormat, Substring, Optionals and more...
Structured Concurrency
Java 24 structured concurrency and gatherers (requires mug-concurrent24 artifact)
Stream-based incremental graph algorithms
BiStream, BiCollector, MoreStreams, MoreCollectors etc.
-
Uses of BiStream in com.google.guava.labs.collect
Methods in com.google.guava.labs.collect that return types with arguments of type BiStreamModifier and TypeMethodDescriptionstatic <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 <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. -
Uses of BiStream in com.google.mu.collect
Methods in com.google.mu.collect that return BiStream -
Uses of BiStream in com.google.mu.util
Methods in com.google.mu.util that return BiStreamModifier and TypeMethodDescriptionSubstring.RepeatingPattern.alternationFrom(String input) Returns the alternation of this pattern from theinputstring, with the matched substring alternated with the trailing substring before the next match.Substring.RepeatingPattern.splitKeyValuesAround(Substring.Pattern keyValueSeparator, String input) Returns aBiStreamof key value pairs frominput.Substring.RepeatingPattern.splitThenTrimKeyValuesAround(Substring.Pattern keyValueSeparator, String input) Returns aBiStreamof key value pairs frominput.BiOptional.stream()Returns aBiStreamview of this BiOptional.Methods in com.google.mu.util with parameters of type BiStreamModifier and TypeMethodDescriptionStringFormat.Interpolator.interpolate(List<String> fragments, BiStream<Substring.Match, Object> placeholders) Interpolates withfragmentsof sizeN + 1andplaceholdersof sizeN. -
Uses of BiStream in com.google.mu.util.concurrent
Methods in com.google.mu.util.concurrent that return types with arguments of type BiStreamModifier and TypeMethodDescriptionParallelizer.inParallel(Function<? super I, ? extends O> concurrentFunction) -
Uses of BiStream in com.google.mu.util.concurrent24
Methods in com.google.mu.util.concurrent24 that return types with arguments of type BiStreamModifier and TypeMethodDescriptionBoundedConcurrency.concurrently(Function<? super I, ? extends O> work) Appliesworkon each input element concurrently and lazily. -
Uses of BiStream in com.google.mu.util.graph
Methods in com.google.mu.util.graph that return BiStreamModifier and TypeMethodDescriptionShortestPath.stream()Returns all nodes from the starting node along this path, with the cumulative distances from the starting node up to each node in the stream, respectively.Method parameters in com.google.mu.util.graph with type arguments of type BiStreamModifier and TypeMethodDescriptionstatic <N> Stream<ShortestPath<N>> ShortestPath.shortestPathsFrom(N startNode, Function<? super N, ? extends BiStream<? extends N, Double>> findSuccessors) Returns a lazy stream of shortest paths starting fromstartNode. -
Uses of BiStream in com.google.mu.util.stream
Methods in com.google.mu.util.stream that return BiStreamModifier and TypeMethodDescriptionReturns aBiStreamconsisting of the pairs in this stream, followed by the pairs inother.Returns aBiStreamconsisting of the pairs in this stream, followed by the pairs inmap.Returns aBiStreamconsisting of the pairs in this stream, followed by the pair ofkeyandvalue.static <K,V> BiStream <K, V> BiStream.biStream(Collection<K> keys, Function<? super K, ? extends V> toValue) Returns aBiStreamof mappings betweenkeysand the corresponding return values of thetoValuefunction.static <T> BiStream<T, T> BiStream.biStream(Collection<T> elements) Short-hand forfrom(elements, identity(), identity()).static <K,V> BiStream <K, V> BiStream.biStream(Function<? super V, ? extends K> toKey, Collection<V> values) Returns aBiStreamof mappings between the key returned by thetoKeyfunction (when applied to each element ofvalues), and the element itself.static <K,V> BiStream <K, V> Returns aBiStreamof mappings between the key returned by thetoKeyfunction (when applied to each element ofvalues), and the element itself.static <K,V> BiStream <K, V> Returns aBiStreamof mappings betweenkeysand the corresponding return values of thetoValuefunction.static <T> BiStream<T, T> Short-hand forfrom(elements, identity(), identity()).BiStream.Builder.build()static <K,V> BiStream <K, V> BiStream.concat(BiStream<? extends K, ? extends V> s1, BiStream<? extends K, ? extends V> s2, BiStream<? extends K, ? extends V>... rest) Returns aBiStreamof the entries froms1,s2thenrestin encounter order.static <K,V> BiStream <K, V> BiStream.concat(Map<? extends K, ? extends V> m1, Map<? extends K, ? extends V> m2, Map<? extends K, ? extends V>... rest) Returns aBiStreamof the entries fromm1,m2thenrestin encounter order.static <K,V> BiStream <K, V> Returns aBiStreamof pairs frombiStreamsconcatenated in encounter order.BiStream.distinct()Returns aBiStreamconsisting of only the distinct pairs (according toObject.equals(Object)for both key and value).static <K,V> BiStream <K, V> BiStream.empty()Returns an emptyBiStream.BiStream.filter(BiPredicate<? super K, ? super V> predicate) Filter this stream to only pairs matchingpredicate.BiStream.filterKeys(Predicate<? super K> predicate) Filter this stream to only pairs whose key matchespredicate.BiStream.filterValues(Predicate<? super V> predicate) Filter this stream to only pairs whose value matchespredicate.final <K2,V2> BiStream <K2, V2> BiStream.flatMap(BiFunction<? super K, ? super V, ? extends BiStream<? extends K2, ? extends V2>> mapper) Maps each pair in this stream to zero or more pairs in anotherBiStream.BiStream.flatMapKeys(BiFunction<? super K, ? super V, ? extends Stream<? extends K2>> keyMapper) Maps each key to zero or more keys of typeK2.BiStream.flatMapKeys(Function<? super K, ? extends Stream<? extends K2>> keyMapper) Maps each key to zero or more keys of typeK2.BiStream.flatMapValues(BiFunction<? super K, ? super V, ? extends Stream<? extends V2>> valueMapper) Maps each value to zero or more values of typeV2.BiStream.flatMapValues(Function<? super V, ? extends Stream<? extends V2>> valueMapper) Maps each value to zero or more values of typeV2.static <K,V> BiStream <K, V> BiStream.from(Collection<? extends Map.Entry<? extends K, ? extends V>> entries) Returns aBiStreamof the key value pairs fromentries.static <T,K, V> BiStream <K, V> BiStream.from(Collection<T> elements, Function<? super T, ? extends K> toKey, Function<? super T, ? extends V> toValue) Deprecated.static <K,V> BiStream <K, V> Returns aBiStreamof the entries inmap.static <K,V> BiStream <K, V> Returns aBiStreamof the pairs fromstream.static <T,K, V> BiStream <K, V> BiStream.from(Stream<T> stream, Function<? super T, ? extends K> toKey, Function<? super T, ? extends V> toValue) Deprecated.UsebiStream(User::id, users)to createBiStream<UserId, User>, or, usebiStream(users, User::getAccount)to createBiStream<User, Account>.BiStream.fromEntries(Stream<E> entryStream) 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.BiStream.groupConsecutiveBy(Function<? super K, ? extends G> classifier, BinaryOperator<V> groupReducer) Returns a lazyBiStreamof the consecutive groups of pairs from this stream.final <G,A, R> BiStream <G, R> BiStream.groupConsecutiveBy(Function<? super K, ? extends G> classifier, Collector<? super V, A, ? extends R> groupCollector) Returns aBiStreamconsisting of consecutive groupings from this stream.BiStream.inverse()Returns aBiStreamwhere each pair is a pair from this stream with the key and value swapped.BiIteration.iterate()Deprecated.Starts iteration over theyieldedpairs.BiStream.limit(int maxSize) Returns aBiStreamconsisting of the only the firstmaxSizepairs of this stream.final <K2,V2> BiStream <K2, V2> BiStream.map(BiFunction<? super K, ? super V, ? extends Both<? extends K2, ? extends V2>> mapper) Returns aBiStreamconsisting of the result pairs of applyingmapperto the pairs in thisBiStream.<K2,V2> BiStream <K2, V2> BiStream.map(BiFunction<? super K, ? super V, ? extends K2> keyMapper, BiFunction<? super K, ? super V, ? extends V2> valueMapper) Returns aBiStreamconsisting of the results of applyingkeyMapperandvalueMapperto the pairs in thisBiStream.final <K2,V2> BiStream <K2, V2> BiStream.mapIfPresent(BiFunction<? super K, ? super V, ? extends BiOptional<? extends K2, ? extends V2>> mapper) Returns aBiStreamconsisting of the results of applyingmapperfunction to the pairs in thisBiStream.BiStream.mapKeys(BiFunction<? super K, ? super V, ? extends K2> keyMapper) Returns aBiStreamof pairs whose keys are the result of applyingkeyMapperto the key of each pair in thisBiStream, and whose values are unchanged.Maps each key to another key of typeK2.BiStream.mapKeysIfPresent(BiFunction<? super K, ? super V, ? extends Optional<? extends K2>> keyMapper) Returns aBiStreamof pairs whose keys are the result of applyingkeyMapperto each pair in thisBiStream, and whose values are unchanged.BiStream.mapKeysIfPresent(Function<? super K, ? extends Optional<? extends K2>> keyMapper) Returns aBiStreamof pairs whose keys are the result of applyingkeyMapperto the key of each pair in thisBiStream, and whose values are unchanged.BiStream.mapKeysIfPresent(Map<? super K, ? extends K2> keyMapping) GivenkeyMappingthat maps the keys of typeKto elements of typeK2, returns aBiStreamof type<K2, V>.BiStream.mapValues(BiFunction<? super K, ? super V, ? extends V2> valueMapper) Maps each value to another value of typeV2.Maps each value to another value of typeV2.BiStream.mapValuesIfPresent(BiFunction<? super K, ? super V, ? extends Optional<? extends V2>> valueMapper) Returns aBiStreamof pairs whose values are the result of applyingvalueMapperto each pair in thisBiStream, and whose keys are unchanged.BiStream.mapValuesIfPresent(Function<? super V, ? extends Optional<? extends V2>> valueMapper) Returns aBiStreamof pairs whose values are the result of applyingvalueMapperto the value of each pair in thisBiStream, and whose keys are unchanged.BiStream.mapValuesIfPresent(Map<? super V, ? extends V2> valueMapping) GivenvalueMappingthat maps values of typeVto result values of typeV2, returns aBiStreamof type<K, V2>.static <K,V> BiStream <K, V> BiStream.of(K key, V value) Returns aBiStreamof a single pair containingkeyandvalue.static <K,V> BiStream <K, V> BiStream.of(K k1, V v1, K k2, V v2) Returns aBiStreamof two pairs, containing the supplied keys and values.static <K,V> BiStream <K, V> BiStream.of(K k1, V v1, K k2, V v2, K k3, V v3) Returns aBiStreamof three pairs, containing the supplied keys and values.static <K,V> BiStream <K, V> BiStream.of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4) Returns aBiStreamof 4 pairs, containing the supplied keys and values.static <K,V> BiStream <K, V> BiStream.of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5) Returns aBiStreamof 5 pairs, containing the supplied keys and values.static <K,V> BiStream <K, V> BiStream.of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6) Returns aBiStreamof 6 pairs, containing the supplied keys and values.static <K,V> BiStream <K, V> BiStream.of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7) Returns aBiStreamof 7 pairs, containing the supplied keys and values.static <K,V> BiStream <K, V> BiStream.of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8) Returns aBiStreamof 8 pairs, containing the supplied keys and values.static <K,V> BiStream <K, V> BiStream.of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8, K k9, V v9) Returns aBiStreamof 9 pairs, containing the supplied keys and values.static <K,V> BiStream <K, V> BiStream.of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8, K k9, V v9, K k10, V v10) Returns aBiStreamof 10 pairs, containing the supplied keys and values.BiStream.peek(BiConsumer<? super K, ? super V> action) Returns aBiStreamconsisting of the pairs of this stream, additionally invokingactionon each pair as pairs are consumed from the resulting stream.static <I,O> BiStream <I, O> BiStream.repeat(Function<? super I, ? extends O> work, I initial, BiFunction<? super I, ? super O, ? extends Optional<? extends I>> increment) Returns a stream of the inputs and outputs from repeated applications of theworkfunction.MoreStreams.runLengthEncode(Stream<T> stream, BiPredicate<? super T, ? super T> sameGroup) Groups consecutive items instreamusing thesameGrouppredicate, along with the group's run length (number of items).BiStream.skip(int n) Returns aBiStreamconsisting of the remaining pairs from this stream, after discarding the firstnpairs.BiStream.skipIf(BiPredicate<? super K, ? super V> predicate) Filter this stream to exclude pairs matchingpredicate.BiStream.skipKeysIf(Predicate<? super K> predicate) Filter this stream to exclude pairs whose key matchespredicate.BiStream.skipValuesIf(Predicate<? super V> predicate) Filter this stream to exclude pairs whose value matchespredicate.BiStream.sorted(Comparator<? super K> byKey, Comparator<? super V> byValue) Returns aBiStreamconsisting of the pairs in this stream, in the order produced by applying thebyKeycomparator on the keys of each pair, and then thebyValuecomparator on the values of pairs with equal keys.BiStream.sortedBy(BiFunction<? super K, ? super V, T> sortKeyFunction, Comparator<? super T> comparator) Returns aBiStreamconsisting of the pairs in this stream, in the order produced by applyingcomparatoron the result of applying thesortKeyFunction.BiStream.sortedByKeys(Comparator<? super K> comparator) Returns aBiStreamconsisting of the pairs in this stream, in the order produced by applyingcomparatoron the keys of each pair.BiStream.sortedByValues(Comparator<? super V> comparator) Returns aBiStreamconsisting of the pairs in this stream, in the order produced by applyingcomparatoron the values of each pair.static <L,R> BiStream <L, R> BiStream.zip(Collection<L> left, Collection<R> right) Returns aBiStreamin which the first element inleftis paired with the first element inright; the second paired with the corresponding second and the third with the corresponding third etc.static <L,R> BiStream <L, R> Returns aBiStreamin which the first element inleftis paired with the first element inright; the second paired with the corresponding second and the third with the corresponding third etc.Methods in com.google.mu.util.stream that return types with arguments of type BiStreamModifier and TypeMethodDescriptionBiStream.concatenating(Function<? super T, ? extends BiStream<? extends K, ? extends V>> toBiStream) Returns aCollectorthat concatenatesBiStreamobjects derived from the input elements using the giventoBiStreamfunction.BiStream.crossJoining(Stream<R> right) Returns aCollectorthat will pair each input element with each element fromrightinto a newBiStream.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 <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.BiStream.groupingBy(Function<? super T, ? extends K> classifier) Returns aCollectorthat groups the input elements byclassifierand collects the values mapping to the same key into aList.BiStream.groupingBy(Function<? super T, ? extends K> classifier, Function<? super T, ? extends V> mapper, BinaryOperator<V> reducer) Returns aCollectorthat groups the input elements byclassifierand reduces the values mapping to the same key usingmapperthenreducer.BiStream.groupingBy(Function<? super T, ? extends K> classifier, Collector<? super T, ?, V> valueCollector) Returns aCollectorthat groups the input elements byclassifierand collects the values mapping to the same key usingvalueCollector.BiStream.groupingBy(Function<? super V, ? extends K> classifier, BinaryOperator<V> reducer) Returns aCollectorthat groups the input elements byclassifierand reduces the values mapping to the same key usingreducer.BiStream.groupingByEach(Function<? super T, ? extends Stream<? extends K>> keysFunction, Function<? super T, ? extends V> valueFunction, BinaryOperator<V> groupReducer) Returns aCollectorgrouping input elements by each of the multiple keys returned by thekeysFunction.BiStream.groupingByEach(Function<? super T, ? extends Stream<? extends K>> keysFunction, Function<? super T, ? extends V> valueFunction, Collector<V, ?, G> groupCollector) Returns aCollectorgrouping input elements by each of the multiple keys returned by thekeysFunction.BiStream.groupingByEach(Function<? super T, ? extends Stream<? extends K>> keysFunction, Collector<T, ?, V> groupCollector) Returns aCollectorgrouping input elements by each of the multiple keys returned by thekeysFunction.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> 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.BiStream.toAdjacentPairs()Returns aCollectorthat accumulates every neighboring pair of elements into a newBiStream.BiStream.toBiStream()Returns aCollectorthat copies each input element as a pair of itself into an equivalentBiStream.BiStream.toBiStream(Function<? super E, ? extends Both<? extends K, ? extends V>> toPair) Returns aCollectorthat splits each input element as a pair and collects them into aBiStream.BiStream.toBiStream(Function<? super E, ? extends K> toKey, Function<? super E, ? extends V> toValue) Returns aCollectorthat splits each input element as a pair and collects them into aBiStream.Methods in com.google.mu.util.stream with parameters of type BiStreamModifier and TypeMethodDescriptionReturns aBiStreamconsisting of the pairs in this stream, followed by the pairs inother.static <K,V> BiStream <K, V> BiStream.concat(BiStream<? extends K, ? extends V> s1, BiStream<? extends K, ? extends V> s2, BiStream<? extends K, ? extends V>... rest) Returns aBiStreamof the entries froms1,s2thenrestin encounter order.Method parameters in com.google.mu.util.stream with type arguments of type BiStreamModifier and TypeMethodDescriptionstatic <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> BiStream <K, V> Returns aBiStreamof pairs frombiStreamsconcatenated in encounter order.BiStream.concatenating(Function<? super T, ? extends BiStream<? extends K, ? extends V>> toBiStream) Returns aCollectorthat concatenatesBiStreamobjects derived from the input elements using the giventoBiStreamfunction.final <K2,V2> BiStream <K2, V2> BiStream.flatMap(BiFunction<? super K, ? super V, ? extends BiStream<? extends K2, ? extends V2>> mapper) Maps each pair in this stream to zero or more pairs in anotherBiStream.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.
biStream(User::id, users)to createBiStream<UserId, User>, or, usebiStream(users, User::getAccount)to createBiStream<User, Account>.