public final class Collectors
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static <T> java.util.Set<T> |
intersectSets(java.lang.Iterable<? extends java.util.Set<T>> source,
boolean parallel)
Returns the Optional result of the intersection of all sets in the supplied Iterable.
|
static <T> java.util.stream.Collector<java.util.Set<T>,java.util.Set<T>,java.util.Set<T>> |
setIntersecting(java.util.Set<T> smallestSet,
boolean parallel)
Gets a collector which intersects the stream of sets and returns the resulting set.
|
static <T> java.util.stream.Collector<java.util.Set<T>,java.util.Set<T>,java.util.Set<T>> |
setIntersecting(java.util.function.Supplier<java.util.Set<T>> smallestSetSupplier,
boolean parallel)
Gets a collector which intersects the stream of sets and returns the resulting set.
|
static <T,E,K extends java.lang.Iterable<E>,V> |
toMultiKeyMap(java.util.function.Function<? super T,? extends K> keyMapper,
java.util.function.Function<? super T,? extends V> valueMapper)
Gets a MultiKeyMap producing collector.
|
static <T,E,K extends java.lang.Iterable<E>,V> |
toMultiKeyMap(java.util.function.Function<? super T,? extends K> keyMapper,
java.util.function.Function<? super T,? extends V> valueMapper,
java.util.function.BinaryOperator<V> mergeFunction)
Gets a MultiKeyMap producing collector.
|
static <T,E,K extends java.lang.Iterable<E>,V,M extends MultiKeyMap<E,K,V>> |
toMultiKeyMap(java.util.function.Function<? super T,? extends K> keyMapper,
java.util.function.Function<? super T,? extends V> valueMapper,
java.util.function.BinaryOperator<V> mergeFunction,
java.util.function.Supplier<M> multiKeyMapSupplier)
Gets a MultiKeyMap producing collector.
|
public static <T> java.util.Set<T> intersectSets(java.lang.Iterable<? extends java.util.Set<T>> source, boolean parallel)
T
- the type of the elements of the setssource
- the Iterable of the sets to intersect with each otherparallel
- use parallel processing if true, sequential if falsepublic static <T> java.util.stream.Collector<java.util.Set<T>,java.util.Set<T>,java.util.Set<T>> setIntersecting(java.util.Set<T> smallestSet, boolean parallel)
T
- the type of the elements of the setssmallestSet
- the smallest in size element of the stream of sets, any if there are several
of the same sizeparallel
- use parallel processing if true, sequential if falsepublic static <T> java.util.stream.Collector<java.util.Set<T>,java.util.Set<T>,java.util.Set<T>> setIntersecting(java.util.function.Supplier<java.util.Set<T>> smallestSetSupplier, boolean parallel)
T
- the type of the elements of the setssmallestSetSupplier
- the supplier of the smallest in size element of the stream of sets,
any if there are several of the same sizeparallel
- use parallel processing if true, sequential if falsepublic static <T,E,K extends java.lang.Iterable<E>,V> java.util.stream.Collector<T,?,MultiKeyMap<E,K,V>> toMultiKeyMap(java.util.function.Function<? super T,? extends K> keyMapper, java.util.function.Function<? super T,? extends V> valueMapper)
T
- the type of the stream elementsE
- the type of the sub-keys of the MultiKeyMapK
- the type of the keys of the MultiKeyMapV
- the type of the values of the MultiKeyMapkeyMapper
- the key producing mapping functionvalueMapper
- the value producing mapping functionpublic static <T,E,K extends java.lang.Iterable<E>,V> java.util.stream.Collector<T,?,MultiKeyMap<E,K,V>> toMultiKeyMap(java.util.function.Function<? super T,? extends K> keyMapper, java.util.function.Function<? super T,? extends V> valueMapper, java.util.function.BinaryOperator<V> mergeFunction)
T
- the type of the stream elementsE
- the type of the sub-keys of the MultiKeyMapK
- the type of the keys of the MultiKeyMapV
- the type of the values of the MultiKeyMapkeyMapper
- the key producing mapping functionvalueMapper
- the value producing mapping functionmergeFunction
- the value merging functionpublic static <T,E,K extends java.lang.Iterable<E>,V,M extends MultiKeyMap<E,K,V>> java.util.stream.Collector<T,?,M> toMultiKeyMap(java.util.function.Function<? super T,? extends K> keyMapper, java.util.function.Function<? super T,? extends V> valueMapper, java.util.function.BinaryOperator<V> mergeFunction, java.util.function.Supplier<M> multiKeyMapSupplier)
T
- the type of the stream elementsE
- the type of the sub-keys of the MultiKeyMapK
- the type of the keys of the MultiKeyMapV
- the type of the values of the MultiKeyMapkeyMapper
- the key producing mapping functionvalueMapper
- the value producing mapping functionmergeFunction
- the value merging functionmultiKeyMapSupplier
- the MultiKeyMap supplier