public abstract class Collectors
extends java.lang.Object
java.util.stream.Collectors}
Modifier and Type | Class and Description |
---|---|
static class |
Collectors.MoreCollectors |
Modifier and Type | Method and Description |
---|---|
static <T> Collector<T,?,java.math.BigDecimal> |
averagingBigDecimal(Function<? super T,java.math.BigDecimal> mapper) |
static <T> Collector<T,?,java.math.BigDecimal> |
averagingBigInteger(Function<? super T,java.math.BigInteger> mapper) |
static <T> Collector<T,?,u.OptionalDouble> |
averagingDoubble(ToDoubleFunction<? super T> mapper) |
static <T> Collector<T,?,java.lang.Double> |
averagingDouble(ToDoubleFunction<? super T> mapper) |
static <T> Collector<T,?,java.lang.Double> |
averagingInt(ToIntFunction<? super T> mapper) |
static <T> Collector<T,?,u.OptionalDouble> |
averagingIntt(ToIntFunction<? super T> mapper) |
static <T> Collector<T,?,java.lang.Double> |
averagingLong(ToLongFunction<? super T> mapper) |
static <T> Collector<T,?,u.OptionalDouble> |
averagingLongg(ToLongFunction<? super T> mapper) |
static <T,A,R,RR> Collector<T,A,RR> |
collectingAndThen(Collector<T,A,R> downstream,
Function<R,RR> finisher) |
static <T,A,R,RR> Collector<T,A,RR> |
collectingAndThen(java.util.stream.Collector<T,A,R> downstream,
java.util.function.Function<R,RR> finisher) |
static <T> Collector<T,?,java.util.List<?>> |
combine(java.util.Collection<? extends java.util.stream.Collector<? super T,?,?>> collectors) |
static <T,A1,A2,R1,R2> |
combine(Collector<? super T,A1,R1> collector1,
Collector<? super T,A2,R2> collector2) |
static <T,A1,A2,R1,R2> |
combine(java.util.stream.Collector<? super T,A1,R1> collector1,
java.util.stream.Collector<? super T,A2,R2> collector2) |
static <T,A1,A2,R1,R2,R> |
combine(Collector<? super T,A1,R1> collector1,
Collector<? super T,A2,R2> collector2,
BiFunction<? super R1,? super R2,R> finisher) |
static <T,A1,A2,R1,R2,R> |
combine(java.util.stream.Collector<? super T,A1,R1> collector1,
java.util.stream.Collector<? super T,A2,R2> collector2,
java.util.function.BiFunction<? super R1,? super R2,R> finisher) |
static <T,A1,A2,A3,R1,R2,R3> |
combine(Collector<? super T,A1,R1> collector1,
Collector<? super T,A2,R2> collector2,
Collector<? super T,A3,R3> collector3) |
static <T,A1,A2,A3,R1,R2,R3> |
combine(java.util.stream.Collector<? super T,A1,R1> collector1,
java.util.stream.Collector<? super T,A2,R2> collector2,
java.util.stream.Collector<? super T,A3,R3> collector3) |
static <T,A1,A2,A3,A4,R1,R2,R3,R4> |
combine(Collector<? super T,A1,R1> collector1,
Collector<? super T,A2,R2> collector2,
Collector<? super T,A3,R3> collector3,
Collector<? super T,A4,R4> collector4) |
static <T,A1,A2,A3,A4,R1,R2,R3,R4> |
combine(java.util.stream.Collector<? super T,A1,R1> collector1,
java.util.stream.Collector<? super T,A2,R2> collector2,
java.util.stream.Collector<? super T,A3,R3> collector3,
java.util.stream.Collector<? super T,A4,R4> collector4) |
static <T,A1,A2,A3,A4,A5,R1,R2,R3,R4,R5> |
combine(Collector<? super T,A1,R1> collector1,
Collector<? super T,A2,R2> collector2,
Collector<? super T,A3,R3> collector3,
Collector<? super T,A4,R4> collector4,
Collector<? super T,A5,R5> collector5) |
static <T,A1,A2,A3,A4,A5,R1,R2,R3,R4,R5> |
combine(java.util.stream.Collector<? super T,A1,R1> collector1,
java.util.stream.Collector<? super T,A2,R2> collector2,
java.util.stream.Collector<? super T,A3,R3> collector3,
java.util.stream.Collector<? super T,A4,R4> collector4,
java.util.stream.Collector<? super T,A5,R5> collector5) |
static <T,A1,A2,A3,R1,R2,R3,R> |
combine(Collector<? super T,A1,R1> collector1,
Collector<? super T,A2,R2> collector2,
Collector<? super T,A3,R3> collector3,
TriFunction<? super R1,? super R2,? super R3,R> finisher) |
static <T,A1,A2,A3,R1,R2,R3,R> |
combine(java.util.stream.Collector<? super T,A1,R1> collector1,
java.util.stream.Collector<? super T,A2,R2> collector2,
java.util.stream.Collector<? super T,A3,R3> collector3,
TriFunction<? super R1,? super R2,? super R3,R> finisher) |
static <T> Collector<T,?,java.util.List<?>> |
combine(java.util.List<? extends Collector<? super T,?,?>> collectors) |
static Collector<java.lang.CharSequence,?,java.lang.String> |
commonPrefix()
It's copied from StreamEx: https://github.com/amaembo/streamex under Apache License v2 and may be modified.
|
static Collector<java.lang.CharSequence,?,java.lang.String> |
commonSuffix()
It's copied from StreamEx: https://github.com/amaembo/streamex under Apache License v2 and may be modified.
|
static <T> Collector<T,?,java.lang.Long> |
counting() |
static <T> Collector<T,?,java.lang.Integer> |
countingInt() |
static <T> Collector<T,?,java.util.List<T>> |
distinctBy(Function<? super T,?> mapper)
It's copied from StreamEx: https://github.com/amaembo/streamex under Apache License v2 and may be modified.
|
static <T> Collector<T,?,java.lang.Integer> |
distinctCount(Function<? super T,?> mapper)
It's copied from StreamEx: https://github.com/amaembo/streamex under Apache License v2 and may be modified.
|
static <T> Collector<T,?,java.util.List<T>> |
filtering(Predicate<? super T> predicate)
It's copied from StreamEx: https://github.com/amaembo/streamex under Apache License v2 and may be modified.
|
static <T,A,R> Collector<T,?,R> |
filtering(Predicate<? super T> predicate,
Collector<? super T,A,R> downstream)
It's copied from StreamEx: https://github.com/amaembo/streamex under Apache License v2 and may be modified.
|
static <T> Collector<T,?,u.Optional<T>> |
first()
Only works for sequential Stream.
|
static <T> Collector<T,?,java.util.List<T>> |
first(int n)
Only works for sequential Stream.
|
static <T,T2,U> Collector<T,?,java.util.List<U>> |
flatMapping(Function<? super T,? extends Stream<? extends T2>> flatMapper,
BiFunction<? super T,? super T2,? extends U> mapper) |
static <T,T2,U,A,R> |
flatMapping(Function<? super T,? extends Stream<? extends T2>> flatMapper,
BiFunction<? super T,? super T2,? extends U> mapper,
Collector<? super U,A,R> downstream) |
static <T,U> Collector<T,?,java.util.List<U>> |
flatMapping(Function<? super T,? extends Stream<? extends U>> mapper) |
static <T,U,A,R> Collector<T,?,R> |
flatMapping(Function<? super T,? extends Stream<? extends U>> mapper,
Collector<? super U,A,R> downstream) |
static <T,T2,U> Collector<T,?,java.util.List<U>> |
flattMapping(Function<? super T,? extends java.util.Collection<? extends T2>> flatMapper,
BiFunction<? super T,? super T2,? extends U> mapper) |
static <T,T2,U,A,R> |
flattMapping(Function<? super T,? extends java.util.Collection<? extends T2>> flatMapper,
BiFunction<? super T,? super T2,? extends U> mapper,
Collector<? super U,A,R> downstream) |
static <T,U> Collector<T,?,java.util.List<U>> |
flattMapping(Function<? super T,? extends java.util.Collection<? extends U>> mapper) |
static <T,U,A,R> Collector<T,?,R> |
flattMapping(Function<? super T,? extends java.util.Collection<? extends U>> mapper,
Collector<? super U,A,R> downstream) |
static <T,K> Collector<T,?,java.util.Map<K,java.util.List<T>>> |
groupingBy(Function<? super T,? extends K> keyMapper) |
static <T,K,A,D> Collector<T,?,java.util.Map<K,D>> |
groupingBy(Function<? super T,? extends K> keyMapper,
Collector<? super T,A,D> downstream) |
static <T,K,A,D,M extends java.util.Map<K,D>> |
groupingBy(Function<? super T,? extends K> keyMapper,
Collector<? super T,A,D> downstream,
Supplier<? extends M> mapFactory) |
static <T,K,M extends java.util.Map<K,java.util.List<T>>> |
groupingBy(Function<? super T,? extends K> keyMapper,
Supplier<? extends M> mapFactory) |
static <T,K> Collector<T,?,java.util.concurrent.ConcurrentMap<K,java.util.List<T>>> |
groupingByConcurrent(Function<? super T,? extends K> keyMapper) |
static <T,K,A,D> Collector<T,?,java.util.concurrent.ConcurrentMap<K,D>> |
groupingByConcurrent(Function<? super T,? extends K> keyMapper,
Collector<? super T,A,D> downstream) |
static <T,K,A,D,M extends java.util.concurrent.ConcurrentMap<K,D>> |
groupingByConcurrent(Function<? super T,? extends K> keyMapper,
Collector<? super T,A,D> downstream,
Supplier<? extends M> mapFactory) |
static <T,K,M extends java.util.concurrent.ConcurrentMap<K,java.util.List<T>>> |
groupingByConcurrent(Function<? super T,? extends K> keyMapper,
Supplier<? extends M> mapFactory) |
static Collector<java.lang.CharSequence,?,java.lang.String> |
joining() |
static Collector<java.lang.CharSequence,?,java.lang.String> |
joining(java.lang.CharSequence delimiter) |
static Collector<java.lang.CharSequence,?,java.lang.String> |
joining(java.lang.CharSequence delimiter,
java.lang.CharSequence prefix,
java.lang.CharSequence suffix) |
static <T> Collector<T,?,u.Optional<T>> |
last()
Only works for sequential Stream.
|
static <T> Collector<T,?,java.util.List<T>> |
last(int n)
Only works for sequential Stream.
|
static <T,U> Collector<T,?,java.util.List<U>> |
mapping(Function<? super T,? extends U> mapper) |
static <T,U,A,R> Collector<T,?,R> |
mapping(Function<? super T,? extends U> mapper,
Collector<? super U,A,R> downstream) |
static <T extends java.lang.Comparable> |
max() |
static <T extends java.lang.Comparable> |
maxAll()
It's copied from StreamEx: https://github.com/amaembo/streamex under Apache License v2 and may be modified.
|
static <T extends java.lang.Comparable> |
maxAll(boolean areAllLargestSame)
Use occurrences to save the count of largest objects if
areAllLargestSame = true (e.g. |
static <T extends java.lang.Comparable,A,D> |
maxAll(Collector<T,A,D> downstream)
It's copied from StreamEx: https://github.com/amaembo/streamex under Apache License v2 and may be modified.
|
static <T> Collector<T,?,java.util.List<T>> |
maxAll(java.util.Comparator<? super T> comparator)
It's copied from StreamEx: https://github.com/amaembo/streamex under Apache License v2 and may be modified.
|
static <T,A,D> Collector<T,?,D> |
maxAll(java.util.Comparator<? super T> comparator,
Collector<? super T,A,D> downstream)
It's copied from StreamEx: https://github.com/amaembo/streamex under Apache License v2 and may be modified.
|
static <T> Collector<T,?,java.util.List<T>> |
maxAll(java.util.Comparator<? super T> comparator,
int atMostSize) |
static <T> Collector<T,?,java.util.List<T>> |
maxAll(java.util.Comparator<? super T> comparator,
int atMostSize,
boolean areAllLargestSame)
Use occurrences to save the count of largest objects if
areAllLargestSame = true (e.g. |
static <T extends java.lang.Comparable> |
maxAll(int atMostSize,
boolean areAllLargestSame)
Use occurrences to save the count of largest objects if
areAllLargestSame = true (e.g. |
static <T extends java.lang.Comparable,A,D> |
maxAlll(Collector<T,A,D> downstream) |
static <T,A,D> Collector<T,?,Pair<u.Optional<T>,D>> |
maxAlll(java.util.Comparator<? super T> comparator,
Collector<? super T,A,D> downstream) |
static <T,A,D,R> Collector<T,?,R> |
maxAlll(java.util.Comparator<? super T> comparator,
Collector<? super T,A,D> downstream,
Function<Pair<u.Optional<T>,D>,R> finisher) |
static <T> Collector<T,?,u.Optional<T>> |
maxBy(java.util.Comparator<? super T> comparator) |
static <T> Collector<T,?,T> |
maxByOrGet(java.util.Comparator<? super T> comparator,
Supplier<? extends T> other) |
static <T,X extends java.lang.RuntimeException> |
maxByOrThrow(java.util.Comparator<? super T> comparator,
Supplier<? extends X> exceptionSupplier) |
static <T extends java.lang.Comparable> |
min() |
static <T extends java.lang.Comparable> |
minAll()
It's copied from StreamEx: https://github.com/amaembo/streamex under Apache License v2 and may be modified.
|
static <T extends java.lang.Comparable> |
minAll(boolean areAllSmallestSame)
Use occurrences to save the count of largest objects if
areAllSmallestSame = true (e.g. |
static <T extends java.lang.Comparable,A,D> |
minAll(Collector<T,A,D> downstream)
It's copied from StreamEx: https://github.com/amaembo/streamex under Apache License v2 and may be modified.
|
static <T> Collector<T,?,java.util.List<T>> |
minAll(java.util.Comparator<? super T> comparator)
It's copied from StreamEx: https://github.com/amaembo/streamex under Apache License v2 and may be modified.
|
static <T,A,D> Collector<T,?,D> |
minAll(java.util.Comparator<? super T> comparator,
Collector<T,A,D> downstream)
It's copied from StreamEx: https://github.com/amaembo/streamex under Apache License v2 and may be modified.
|
static <T> Collector<T,?,java.util.List<T>> |
minAll(java.util.Comparator<? super T> comparator,
int atMostSize) |
static <T> Collector<T,?,java.util.List<T>> |
minAll(java.util.Comparator<? super T> comparator,
int atMostSize,
boolean areAllSmallestSame)
Use occurrences to save the count of largest objects if
areAllSmallestSame = true (e.g. |
static <T extends java.lang.Comparable> |
minAll(int atMostSize,
boolean areAllSmallestSame)
Use occurrences to save the count of largest objects if
areAllSmallestSame = true (e.g. |
static <T extends java.lang.Comparable,A,D> |
minAlll(Collector<T,A,D> downstream) |
static <T,A,D> Collector<T,?,Pair<u.Optional<T>,D>> |
minAlll(java.util.Comparator<? super T> comparator,
Collector<? super T,A,D> downstream) |
static <T,A,D,R> Collector<T,?,R> |
minAlll(java.util.Comparator<? super T> comparator,
Collector<? super T,A,D> downstream,
Function<Pair<u.Optional<T>,D>,R> finisher) |
static <T> Collector<T,?,u.Optional<T>> |
minBy(java.util.Comparator<? super T> comparator) |
static <T> Collector<T,?,T> |
minByOrGet(java.util.Comparator<? super T> comparator,
Supplier<? extends T> other) |
static <T,X extends java.lang.RuntimeException> |
minByOrThrow(java.util.Comparator<? super T> comparator,
Supplier<? extends X> exceptionSupplier) |
static <T,R> Collector<T,?,u.Optional<Pair<T,T>>> |
minMax(java.util.Comparator<? super T> comparator) |
static <T,R> Collector<T,?,u.Optional<R>> |
minMax(java.util.Comparator<? super T> comparator,
BiFunction<? super T,? super T,? extends R> finisher)
It's copied from StreamEx: https://github.com/amaembo/streamex under Apache License v2 and may be modified.
|
static <T> Collector<T,?,u.Optional<T>> |
onlyOne()
DuplicatedResultException is threw if there are more than one values are collected. |
static <T> Collector<T,?,u.Optional<T>> |
onlyOne(Predicate<? super T> predicate)
DuplicatedResultException is threw if there are more than one values are collected. |
static <T> Collector<T,?,java.util.Map<java.lang.Boolean,java.util.List<T>>> |
partitioningBy(Predicate<? super T> predicate) |
static <T,D,A> Collector<T,?,java.util.Map<java.lang.Boolean,D>> |
partitioningBy(Predicate<? super T> predicate,
Collector<? super T,A,D> downstream) |
static <T> Collector<T,?,u.Optional<T>> |
reducing(BinaryOperator<T> op) |
static <T,U> Collector<T,?,u.Optional<U>> |
reducing(Function<? super T,? extends U> mapper,
BinaryOperator<U> op) |
static <T> Collector<T,?,T> |
reducing(T identity,
BinaryOperator<T> op) |
static <T,U> Collector<T,?,U> |
reducing(U identity,
Function<? super T,? extends U> mapper,
BinaryOperator<U> op) |
static <T> Collector<T,?,T> |
reducingOrGet(BinaryOperator<T> op,
Supplier<? extends T> other) |
static <T,U> Collector<T,?,U> |
reducingOrGet(Function<? super T,? extends U> mapper,
BinaryOperator<U> op,
Supplier<? extends U> other) |
static <T,X extends java.lang.RuntimeException> |
reducingOrThrow(BinaryOperator<T> op,
Supplier<? extends X> exceptionSupplier) |
static <T,U,X extends java.lang.RuntimeException> |
reducingOrThrow(Function<? super T,? extends U> mapper,
BinaryOperator<U> op,
Supplier<? extends X> exceptionSupplier) |
static <T,R> Collector<T,?,R> |
streaming(Function<? super Stream<T>,R> streamingCollector)
Note: Generally it's much slower than other
Collectors . |
static <T,R> Collector<T,?,R> |
streaming(long maxWaitIntervalInMillis,
Function<? super Stream<T>,R> streamingCollector)
Note: Generally it's much slower than other
Collectors . |
static <T,R> Collector<T,?,R> |
streaming(long maxWaitIntervalInMillis,
Supplier<? extends java.util.concurrent.BlockingQueue<T>> queueSupplier,
Function<? super Stream<T>,R> streamingCollector)
Note: Generally it's much slower than other
Collectors . |
static <T,R> Collector<T,?,R> |
streaming(Supplier<? extends java.util.concurrent.BlockingQueue<T>> queueSupplier,
Function<? super Stream<T>,ContinuableFuture<R>> streamingCollector,
long maxWaitIntervalInMillis)
Note: Generally it's much slower than other
Collectors . |
static <T,R> Collector<T,?,R> |
streaming(Supplier<? extends java.util.concurrent.BlockingQueue<T>> queueSupplier,
Function<? super Stream<T>,R> streamingCollector)
Note: Generally it's much slower than other
Collectors . |
static <T> Collector<T,?,com.landawn.abacus.util.ByteSummaryStatistics> |
summarizingByte(ToByteFunction<? super T> mapper) |
static <T> Collector<T,?,com.landawn.abacus.util.CharSummaryStatistics> |
summarizingChar(ToCharFunction<? super T> mapper) |
static <T> Collector<T,?,DoubleSummaryStatistics> |
summarizingDouble(ToDoubleFunction<? super T> mapper) |
static <T> Collector<T,?,com.landawn.abacus.util.FloatSummaryStatistics> |
summarizingFloat(ToFloatFunction<? super T> mapper) |
static <T> Collector<T,?,IntSummaryStatistics> |
summarizingInt(ToIntFunction<? super T> mapper) |
static <T> Collector<T,?,LongSummaryStatistics> |
summarizingLong(ToLongFunction<? super T> mapper) |
static <T> Collector<T,?,com.landawn.abacus.util.ShortSummaryStatistics> |
summarizingShort(ToShortFunction<? super T> mapper) |
static <T> Collector<T,?,java.math.BigDecimal> |
summingBigDecimal(Function<? super T,java.math.BigDecimal> mapper) |
static <T> Collector<T,?,java.math.BigInteger> |
summingBigInteger(Function<? super T,java.math.BigInteger> mapper) |
static <T> Collector<T,?,u.OptionalDouble> |
summingDoubble(ToDoubleFunction<? super T> mapper) |
static <T> Collector<T,?,java.lang.Double> |
summingDouble(ToDoubleFunction<? super T> mapper) |
static <T> Collector<T,?,java.lang.Integer> |
summingInt(ToIntFunction<? super T> mapper) |
static <T> Collector<T,?,u.OptionalInt> |
summingIntt(ToIntFunction<? super T> mapper) |
static <T> Collector<T,?,java.lang.Long> |
summingLong(ToLongFunction<? super T> mapper) |
static <T> Collector<T,?,u.OptionalLong> |
summingLongg(ToLongFunction<? super T> mapper) |
static <T> Collector<T,?,java.lang.Object[]> |
toArray() |
static <T,A> Collector<T,?,A[]> |
toArray(IntFunction<A[]> arraySupplier) |
static <T,A> Collector<T,?,A[]> |
toArray(Supplier<A[]> arraySupplier) |
static <T,K,V> Collector<T,?,BiMap<K,V>> |
toBiMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper) |
static <T,K,V> Collector<T,?,BiMap<K,V>> |
toBiMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper,
BinaryOperator<V> mergeFunction) |
static <T,K,V> Collector<T,?,BiMap<K,V>> |
toBiMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper,
BinaryOperator<V> mergeFunction,
Supplier<BiMap<K,V>> mapFactory) |
static <T,K,V> Collector<T,?,BiMap<K,V>> |
toBiMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper,
Supplier<BiMap<K,V>> mapFactory) |
static Collector<java.lang.Boolean,?,boolean[]> |
toBooleanArray() |
static Collector<java.lang.Boolean,?,BooleanList> |
toBooleanList() |
static Collector<java.lang.Byte,?,byte[]> |
toByteArray() |
static Collector<java.lang.Byte,?,ByteList> |
toByteList() |
static Collector<java.lang.Character,?,char[]> |
toCharArray() |
static Collector<java.lang.Character,?,CharList> |
toCharList() |
static <T,C extends java.util.Collection<T>> |
toCollection(Supplier<? extends C> collectionFactory) |
static <T,C extends java.util.Collection<T>> |
toCollection(Supplier<? extends C> collectionFactory,
int atMostSize) |
static <T,K,V> Collector<T,?,java.util.concurrent.ConcurrentMap<K,V>> |
toConcurrentMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper) |
static <T,K,V> Collector<T,?,java.util.concurrent.ConcurrentMap<K,V>> |
toConcurrentMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper,
BinaryOperator<V> mergeFunction) |
static <T,K,V,M extends java.util.concurrent.ConcurrentMap<K,V>> |
toConcurrentMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper,
BinaryOperator<V> mergeFunction,
Supplier<? extends M> mapFactory) |
static <T,K,V,M extends java.util.concurrent.ConcurrentMap<K,V>> |
toConcurrentMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper,
Supplier<? extends M> mapFactory) |
static <T> Collector<T,?,DataSet> |
toDataSet() |
static <T> Collector<T,?,DataSet> |
toDataSet(java.util.List<java.lang.String> columnNames) |
static <T> Collector<T,?,java.util.Deque<T>> |
toDeque() |
static Collector<java.lang.Double,?,double[]> |
toDoubleArray() |
static Collector<java.lang.Double,?,DoubleList> |
toDoubleList() |
static Collector<java.lang.Float,?,float[]> |
toFloatArray() |
static Collector<java.lang.Float,?,FloatList> |
toFloatList() |
static <T> Collector<T,?,ImmutableList<T>> |
toImmutableList() |
static <K,V> Collector<java.util.Map.Entry<K,V>,?,ImmutableMap<K,V>> |
toImmutableMap() |
static <K,V> Collector<java.util.Map.Entry<K,V>,?,ImmutableMap<K,V>> |
toImmutableMap(BinaryOperator<V> mergeFunction) |
static <T,K,V> Collector<T,?,ImmutableMap<K,V>> |
toImmutableMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper) |
static <T,K,V> Collector<T,?,ImmutableMap<K,V>> |
toImmutableMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper,
BinaryOperator<V> mergeFunction) |
static <T> Collector<T,?,ImmutableSet<T>> |
toImmutableSet() |
static Collector<java.lang.Integer,?,int[]> |
toIntArray() |
static Collector<java.lang.Integer,?,IntList> |
toIntList() |
static <T,K,V> Collector<T,?,java.util.LinkedHashMap<K,V>> |
toLinkedHashMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper) |
static <T,K,V> Collector<T,?,java.util.LinkedHashMap<K,V>> |
toLinkedHashMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper,
BinaryOperator<V> mergeFunction) |
static <T> Collector<T,?,java.util.LinkedHashSet<T>> |
toLinkedHashSet() |
static <T> Collector<T,?,java.util.LinkedList<T>> |
toLinkedList() |
static <T> Collector<T,?,java.util.List<T>> |
toList() |
static <T> Collector<T,?,java.util.List<T>> |
toList(int atMostSize) |
static Collector<java.lang.Long,?,long[]> |
toLongArray() |
static Collector<java.lang.Long,?,LongList> |
toLongList() |
static <T> Collector<T,?,LongMultiset<T>> |
toLongMultiset() |
static <T> Collector<T,?,LongMultiset<T>> |
toLongMultiset(Supplier<LongMultiset<T>> supplier) |
static <K,V> Collector<java.util.Map.Entry<K,V>,?,java.util.Map<K,V>> |
toMap() |
static <K,V> Collector<java.util.Map.Entry<K,V>,?,java.util.Map<K,V>> |
toMap(BinaryOperator<V> mergeFunction) |
static <K,V,M extends java.util.Map<K,V>> |
toMap(BinaryOperator<V> mergeFunction,
Supplier<? extends M> mapFactory) |
static <T,K,A,D> Collector<T,?,java.util.Map<K,D>> |
toMap(Function<? super T,? extends K> keyMapper,
Collector<? super T,A,D> downstream) |
static <T,K,A,D,M extends java.util.Map<K,D>> |
toMap(Function<? super T,? extends K> keyMapper,
Collector<? super T,A,D> downstream,
Supplier<? extends M> mapFactory) |
static <T,K,V> Collector<T,?,java.util.Map<K,V>> |
toMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper) |
static <T,K,V> Collector<T,?,java.util.Map<K,V>> |
toMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper,
BinaryOperator<V> mergeFunction) |
static <T,K,V,M extends java.util.Map<K,V>> |
toMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper,
BinaryOperator<V> mergeFunction,
Supplier<? extends M> mapFactory) |
static <T,K,V,A,D> |
toMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper,
Collector<? super V,A,D> downstream) |
static <T,K,V,A,D,M extends java.util.Map<K,D>> |
toMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper,
Collector<? super V,A,D> downstream,
Supplier<? extends M> mapFactory) |
static <T,K,V,M extends java.util.Map<K,V>> |
toMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper,
Supplier<? extends M> mapFactory) |
static <K,V,M extends java.util.Map<K,V>> |
toMap(Supplier<? extends M> mapFactory) |
static <K,V> Collector<java.util.Map.Entry<? extends K,? extends V>,?,ListMultimap<K,V>> |
toMultimap() |
static <T,K> Collector<T,?,ListMultimap<K,T>> |
toMultimap(Function<? super T,? extends K> keyMapper) |
static <T,K,V> Collector<T,?,ListMultimap<K,V>> |
toMultimap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper) |
static <T,K,V,C extends java.util.Collection<V>,M extends Multimap<K,V,C>> |
toMultimap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper,
Supplier<? extends M> mapFactory) |
static <T,K,C extends java.util.Collection<T>,M extends Multimap<K,T,C>> |
toMultimap(Function<? super T,? extends K> keyMapper,
Supplier<? extends M> mapFactory) |
static <K,V,C extends java.util.Collection<V>,M extends Multimap<K,V,C>> |
toMultimap(Supplier<? extends M> mapFactory) |
static <T> Collector<T,?,Multiset<T>> |
toMultiset() |
static <T> Collector<T,?,Multiset<T>> |
toMultiset(Supplier<Multiset<T>> supplier) |
static <T> Collector<T,?,java.util.Queue<T>> |
toQueue() |
static <T> Collector<T,?,java.util.Set<T>> |
toSet() |
static <T> Collector<T,?,java.util.Set<T>> |
toSet(int atMostSize) |
static Collector<java.lang.Short,?,short[]> |
toShortArray() |
static Collector<java.lang.Short,?,ShortList> |
toShortList() |
public static <T,C extends java.util.Collection<T>> Collector<T,?,C> toCollection(Supplier<? extends C> collectionFactory)
public static <T> Collector<T,?,java.util.List<T>> toList()
public static <T> Collector<T,?,java.util.LinkedList<T>> toLinkedList()
public static <T> Collector<T,?,ImmutableList<T>> toImmutableList()
public static <T> Collector<T,?,java.util.Set<T>> toSet()
public static <T> Collector<T,?,java.util.LinkedHashSet<T>> toLinkedHashSet()
public static <T> Collector<T,?,ImmutableSet<T>> toImmutableSet()
public static <T> Collector<T,?,java.util.Queue<T>> toQueue()
public static <T> Collector<T,?,java.util.Deque<T>> toDeque()
public static <T,C extends java.util.Collection<T>> Collector<T,?,C> toCollection(Supplier<? extends C> collectionFactory, int atMostSize)
public static <T> Collector<T,?,java.util.List<T>> toList(int atMostSize)
public static <T> Collector<T,?,java.util.Set<T>> toSet(int atMostSize)
public static <T> Collector<T,?,LongMultiset<T>> toLongMultiset()
public static <T> Collector<T,?,LongMultiset<T>> toLongMultiset(Supplier<LongMultiset<T>> supplier)
public static <T> Collector<T,?,java.lang.Object[]> toArray()
public static <T,A> Collector<T,?,A[]> toArray(IntFunction<A[]> arraySupplier)
public static Collector<java.lang.Boolean,?,BooleanList> toBooleanList()
public static Collector<java.lang.Boolean,?,boolean[]> toBooleanArray()
public static Collector<java.lang.Character,?,char[]> toCharArray()
public static Collector<java.lang.Byte,?,byte[]> toByteArray()
public static Collector<java.lang.Short,?,short[]> toShortArray()
public static Collector<java.lang.Integer,?,int[]> toIntArray()
public static Collector<java.lang.Long,?,long[]> toLongArray()
public static Collector<java.lang.Float,?,float[]> toFloatArray()
public static Collector<java.lang.Double,?,DoubleList> toDoubleList()
public static Collector<java.lang.Double,?,double[]> toDoubleArray()
public static <T> Collector<T,?,u.Optional<T>> onlyOne()
DuplicatedResultException
is threw if there are more than one values are collected.public static <T> Collector<T,?,u.Optional<T>> onlyOne(Predicate<? super T> predicate)
DuplicatedResultException
is threw if there are more than one values are collected.predicate
- public static <T> Collector<T,?,u.Optional<T>> first()
java.lang.UnsupportedOperationException
- operated by multiple threadspublic static <T> Collector<T,?,u.Optional<T>> last()
java.lang.UnsupportedOperationException
- operated by multiple threadspublic static <T> Collector<T,?,java.util.List<T>> first(int n)
n
- java.lang.UnsupportedOperationException
- operated by multiple threadspublic static <T> Collector<T,?,java.util.List<T>> last(int n)
n
- java.lang.UnsupportedOperationException
- operated by multiple threadspublic static Collector<java.lang.CharSequence,?,java.lang.String> joining()
public static Collector<java.lang.CharSequence,?,java.lang.String> joining(java.lang.CharSequence delimiter)
public static Collector<java.lang.CharSequence,?,java.lang.String> joining(java.lang.CharSequence delimiter, java.lang.CharSequence prefix, java.lang.CharSequence suffix)
public static <T> Collector<T,?,java.util.List<T>> filtering(Predicate<? super T> predicate)
Collector
which filters input elements by the supplied
predicate, collecting them to the list.
This method behaves like
filtering(predicate, Collectors.toList())
.
There are no guarantees on the type, mutability, serializability, or
thread-safety of the List
returned.
T
- the type of the input elementspredicate
- a filter function to be applied to the input elementsList
filtering(Predicate, Collector)
public static <T,A,R> Collector<T,?,R> filtering(Predicate<? super T> predicate, Collector<? super T,A,R> downstream)
Collector
which passes only those elements to the
specified downstream collector which match given predicate.
This method returns a short-circuiting collector if downstream collector is short-circuiting.
The operation performed by the returned collector is equivalent to
stream.filter(predicate).collect(downstream)
. This collector is
mostly useful as a downstream collector in cascaded operation involving
#pairing(Collector, Collector, BiFunction)
collector.
This method is similar to Collectors.filtering
method which
appears in JDK 9. However when downstream collector is
short-circuiting
, this method will also return a short-circuiting collector.
T
- the type of the input elementsA
- intermediate accumulation type of the downstream collectorR
- result type of collectorpredicate
- a filter function to be applied to the input elementsdownstream
- a collector which will accept filtered values#pairing(Collector, Collector, BiFunction)
public static <T,U> Collector<T,?,java.util.List<U>> mapping(Function<? super T,? extends U> mapper)
public static <T,U,A,R> Collector<T,?,R> mapping(Function<? super T,? extends U> mapper, Collector<? super U,A,R> downstream)
public static <T,U> Collector<T,?,java.util.List<U>> flatMapping(Function<? super T,? extends Stream<? extends U>> mapper)
public static <T,U,A,R> Collector<T,?,R> flatMapping(Function<? super T,? extends Stream<? extends U>> mapper, Collector<? super U,A,R> downstream)
public static <T,U> Collector<T,?,java.util.List<U>> flattMapping(Function<? super T,? extends java.util.Collection<? extends U>> mapper)
public static <T,U,A,R> Collector<T,?,R> flattMapping(Function<? super T,? extends java.util.Collection<? extends U>> mapper, Collector<? super U,A,R> downstream)
public static <T,T2,U> Collector<T,?,java.util.List<U>> flatMapping(Function<? super T,? extends Stream<? extends T2>> flatMapper, BiFunction<? super T,? super T2,? extends U> mapper)
public static <T,T2,U,A,R> Collector<T,?,R> flatMapping(Function<? super T,? extends Stream<? extends T2>> flatMapper, BiFunction<? super T,? super T2,? extends U> mapper, Collector<? super U,A,R> downstream)
public static <T,T2,U> Collector<T,?,java.util.List<U>> flattMapping(Function<? super T,? extends java.util.Collection<? extends T2>> flatMapper, BiFunction<? super T,? super T2,? extends U> mapper)
public static <T,T2,U,A,R> Collector<T,?,R> flattMapping(Function<? super T,? extends java.util.Collection<? extends T2>> flatMapper, BiFunction<? super T,? super T2,? extends U> mapper, Collector<? super U,A,R> downstream)
public static <T,A,R,RR> Collector<T,A,RR> collectingAndThen(Collector<T,A,R> downstream, Function<R,RR> finisher)
public static <T,A,R,RR> Collector<T,A,RR> collectingAndThen(java.util.stream.Collector<T,A,R> downstream, java.util.function.Function<R,RR> finisher)
public static <T> Collector<T,?,java.util.List<T>> distinctBy(Function<? super T,?> mapper)
Collector
which collects into the List
the
input elements for which given mapper function returns distinct results.
For ordered source the order of collected elements is preserved. If the same result is returned by mapper function for several elements, only the first element is included into the resulting list.
There are no guarantees on the type, mutability, serializability, or
thread-safety of the List
returned.
The operation performed by the returned collector is equivalent to
stream.distinct(mapper).toList()
, but may work faster.
T
- the type of the input elementsmapper
- a function which classifies input elements.List
.public static <T> Collector<T,?,java.lang.Integer> distinctCount(Function<? super T,?> mapper)
Collector
which counts a number of distinct values the
mapper function returns for the stream elements.
The operation performed by the returned collector is equivalent to
stream.map(mapper).distinct().count()
. This collector is mostly
useful as a downstream collector.
T
- the type of the input elementsmapper
- a function which classifies input elements.public static <T> Collector<T,?,java.lang.Long> counting()
public static <T> Collector<T,?,java.lang.Integer> countingInt()
public static <T extends java.lang.Comparable> Collector<T,?,u.Optional<T>> min()
public static <T> Collector<T,?,u.Optional<T>> minBy(java.util.Comparator<? super T> comparator)
public static <T> Collector<T,?,T> minByOrGet(java.util.Comparator<? super T> comparator, Supplier<? extends T> other)
public static <T,X extends java.lang.RuntimeException> Collector<T,?,T> minByOrThrow(java.util.Comparator<? super T> comparator, Supplier<? extends X> exceptionSupplier)
public static <T extends java.lang.Comparable> Collector<T,?,u.Optional<T>> max()
public static <T> Collector<T,?,u.Optional<T>> maxBy(java.util.Comparator<? super T> comparator)
public static <T> Collector<T,?,T> maxByOrGet(java.util.Comparator<? super T> comparator, Supplier<? extends T> other)
public static <T,X extends java.lang.RuntimeException> Collector<T,?,T> maxByOrThrow(java.util.Comparator<? super T> comparator, Supplier<? extends X> exceptionSupplier)
public static <T,R> Collector<T,?,u.Optional<Pair<T,T>>> minMax(java.util.Comparator<? super T> comparator)
comparator
- minMax(Comparator, BiFunction)
public static <T,R> Collector<T,?,u.Optional<R>> minMax(java.util.Comparator<? super T> comparator, BiFunction<? super T,? super T,? extends R> finisher)
Collector
which finds the minimal and maximal element
according to the supplied comparator, then applies finisher function to
them producing the final result.
This collector produces stable result for ordered stream: if several minimal or maximal elements appear, the collector always selects the first encountered.
If there are no input elements, the finisher method is not called and
empty Optional
is returned. Otherwise the finisher result is
wrapped into Optional
.
T
- the type of the input elementsR
- the type of the result wrapped into Optional
comparator
- comparator which is used to find minimal and maximal
elementfinisher
- a BiFunction
which takes minimal and maximal
element and produces the final result.Collector
which finds minimal and maximal elements.public static <T extends java.lang.Comparable> Collector<T,?,java.util.List<T>> maxAll()
Collector
which finds all the elements which are equal
to each other and bigger than any other element according to the natural
order. The found elements are collected to List
.T
- the type of the input elementsCollector
which finds all the maximal elements and
collects them to the List
.maxAll(Comparator)
,
maxAll(Collector)
public static <T> Collector<T,?,java.util.List<T>> maxAll(java.util.Comparator<? super T> comparator)
Collector
which finds all the elements which are equal
to each other and bigger than any other element according to the
specified Comparator
. The found elements are collected to
List
.T
- the type of the input elementscomparator
- a Comparator
to compare the elementsCollector
which finds all the maximal elements and
collects them to the List
.maxAll(Comparator, Collector)
,
maxAll()
public static <T> Collector<T,?,java.util.List<T>> maxAll(java.util.Comparator<? super T> comparator, int atMostSize)
comparator
- atMostSize
- public static <T extends java.lang.Comparable> Collector<T,?,java.util.List<T>> maxAll(boolean areAllLargestSame)
areAllLargestSame = true
(e.g. Number/String/...
) and return a list by repeat the largest object n
times.areAllLargestSame
- maxAll(Comparator, int, boolean)
public static <T extends java.lang.Comparable> Collector<T,?,java.util.List<T>> maxAll(int atMostSize, boolean areAllLargestSame)
areAllLargestSame = true
(e.g. Number/String/...
) and return a list by repeat the largest object n
times.atMostSize
- areAllLargestSame
- maxAll(Comparator, int, boolean)
public static <T> Collector<T,?,java.util.List<T>> maxAll(java.util.Comparator<? super T> comparator, int atMostSize, boolean areAllLargestSame)
areAllLargestSame = true
(e.g. Number/String/...
) and return a list by repeat the largest object n
times.
The default implementation is equivalent to, for this map
:
if (areAllLargestSame) {
final Function, Integer>, List> finisher = new Function, Integer>, List>() {
atMostSize
- areAllLargestSame
- public static <T extends java.lang.Comparable,A,D> Collector<T,?,D> maxAll(Collector<T,A,D> downstream)
Collector
which finds all the elements which are equal
to each other and bigger than any other element according to the natural
order. The found elements are reduced using the specified downstream
Collector
.T
- the type of the input elementsA
- the intermediate accumulation type of the downstream collectorD
- the result type of the downstream reductiondownstream
- a Collector
implementing the downstream
reductionCollector
which finds all the maximal elements.maxAll(Comparator, Collector)
,
maxAll(Comparator)
,
maxAll()
public static <T,A,D> Collector<T,?,D> maxAll(java.util.Comparator<? super T> comparator, Collector<? super T,A,D> downstream)
Collector
which finds all the elements which are equal
to each other and bigger than any other element according to the
specified Comparator
. The found elements are reduced using the
specified downstream Collector
.T
- the type of the input elementsA
- the intermediate accumulation type of the downstream collectorD
- the result type of the downstream reductioncomparator
- a Comparator
to compare the elementsdownstream
- a Collector
implementing the downstream
reductionCollector
which finds all the maximal elements.maxAll(Comparator)
,
maxAll(Collector)
,
maxAll()
public static <T extends java.lang.Comparable,A,D> Collector<T,?,Pair<u.Optional<T>,D>> maxAlll(Collector<T,A,D> downstream)
public static <T,A,D> Collector<T,?,Pair<u.Optional<T>,D>> maxAlll(java.util.Comparator<? super T> comparator, Collector<? super T,A,D> downstream)
public static <T,A,D,R> Collector<T,?,R> maxAlll(java.util.Comparator<? super T> comparator, Collector<? super T,A,D> downstream, Function<Pair<u.Optional<T>,D>,R> finisher)
public static <T extends java.lang.Comparable> Collector<T,?,java.util.List<T>> minAll()
Collector
which finds all the elements which are equal
to each other and smaller than any other element according to the natural
order. The found elements are collected to List
.T
- the type of the input elementsCollector
which finds all the minimal elements and
collects them to the List
.minAll(Comparator)
,
minAll(Collector)
public static <T> Collector<T,?,java.util.List<T>> minAll(java.util.Comparator<? super T> comparator)
Collector
which finds all the elements which are equal
to each other and smaller than any other element according to the
specified Comparator
. The found elements are collected to
List
.T
- the type of the input elementscomparator
- a Comparator
to compare the elementsCollector
which finds all the minimal elements and
collects them to the List
.minAll(Comparator, Collector)
,
minAll()
public static <T> Collector<T,?,java.util.List<T>> minAll(java.util.Comparator<? super T> comparator, int atMostSize)
comparator
- atMostSize
- public static <T extends java.lang.Comparable> Collector<T,?,java.util.List<T>> minAll(boolean areAllSmallestSame)
areAllSmallestSame = true
(e.g. Number/String/...
) and return a list by repeat the smallest object n
times.areAllSmallestSame
- maxAll(Comparator, int, boolean)
public static <T extends java.lang.Comparable> Collector<T,?,java.util.List<T>> minAll(int atMostSize, boolean areAllSmallestSame)
areAllSmallestSame = true
(e.g. Number/String/...
) and return a list by repeat the smallest object n
times.atMostSize
- areAllSmallestSame
- maxAll(Comparator, int, boolean)
public static <T> Collector<T,?,java.util.List<T>> minAll(java.util.Comparator<? super T> comparator, int atMostSize, boolean areAllSmallestSame)
areAllSmallestSame = true
(e.g. Number/String/...
) and return a list by repeat the smallest object n
times.comparator
- atMostSize
- areAllSmallestSame
- maxAll(Comparator, int, boolean)
public static <T extends java.lang.Comparable,A,D> Collector<T,?,D> minAll(Collector<T,A,D> downstream)
Collector
which finds all the elements which are equal
to each other and smaller than any other element according to the natural
order. The found elements are reduced using the specified downstream
Collector
.T
- the type of the input elementsA
- the intermediate accumulation type of the downstream collectorD
- the result type of the downstream reductiondownstream
- a Collector
implementing the downstream
reductionCollector
which finds all the minimal elements.minAll(Comparator, Collector)
,
minAll(Comparator)
,
minAll()
public static <T,A,D> Collector<T,?,D> minAll(java.util.Comparator<? super T> comparator, Collector<T,A,D> downstream)
Collector
which finds all the elements which are equal
to each other and smaller than any other element according to the
specified Comparator
. The found elements are reduced using the
specified downstream Collector
.T
- the type of the input elementsA
- the intermediate accumulation type of the downstream collectorD
- the result type of the downstream reductioncomparator
- a Comparator
to compare the elementsdownstream
- a Collector
implementing the downstream
reductionCollector
which finds all the minimal elements.minAll(Comparator)
,
minAll(Collector)
,
minAll()
public static <T extends java.lang.Comparable,A,D> Collector<T,?,Pair<u.Optional<T>,D>> minAlll(Collector<T,A,D> downstream)
public static <T,A,D> Collector<T,?,Pair<u.Optional<T>,D>> minAlll(java.util.Comparator<? super T> comparator, Collector<? super T,A,D> downstream)
public static <T,A,D,R> Collector<T,?,R> minAlll(java.util.Comparator<? super T> comparator, Collector<? super T,A,D> downstream, Function<Pair<u.Optional<T>,D>,R> finisher)
public static <T> Collector<T,?,java.lang.Integer> summingInt(ToIntFunction<? super T> mapper)
public static <T> Collector<T,?,u.OptionalInt> summingIntt(ToIntFunction<? super T> mapper)
public static <T> Collector<T,?,java.lang.Long> summingLong(ToLongFunction<? super T> mapper)
public static <T> Collector<T,?,u.OptionalLong> summingLongg(ToLongFunction<? super T> mapper)
public static <T> Collector<T,?,java.lang.Double> summingDouble(ToDoubleFunction<? super T> mapper)
public static <T> Collector<T,?,u.OptionalDouble> summingDoubble(ToDoubleFunction<? super T> mapper)
public static <T> Collector<T,?,java.math.BigInteger> summingBigInteger(Function<? super T,java.math.BigInteger> mapper)
public static <T> Collector<T,?,java.math.BigDecimal> summingBigDecimal(Function<? super T,java.math.BigDecimal> mapper)
public static <T> Collector<T,?,java.lang.Double> averagingInt(ToIntFunction<? super T> mapper)
public static <T> Collector<T,?,u.OptionalDouble> averagingIntt(ToIntFunction<? super T> mapper)
public static <T> Collector<T,?,java.lang.Double> averagingLong(ToLongFunction<? super T> mapper)
public static <T> Collector<T,?,u.OptionalDouble> averagingLongg(ToLongFunction<? super T> mapper)
public static <T> Collector<T,?,java.lang.Double> averagingDouble(ToDoubleFunction<? super T> mapper)
public static <T> Collector<T,?,u.OptionalDouble> averagingDoubble(ToDoubleFunction<? super T> mapper)
public static <T> Collector<T,?,java.math.BigDecimal> averagingBigInteger(Function<? super T,java.math.BigInteger> mapper)
public static <T> Collector<T,?,java.math.BigDecimal> averagingBigDecimal(Function<? super T,java.math.BigDecimal> mapper)
public static <T> Collector<T,?,com.landawn.abacus.util.CharSummaryStatistics> summarizingChar(ToCharFunction<? super T> mapper)
public static <T> Collector<T,?,com.landawn.abacus.util.ByteSummaryStatistics> summarizingByte(ToByteFunction<? super T> mapper)
public static <T> Collector<T,?,com.landawn.abacus.util.ShortSummaryStatistics> summarizingShort(ToShortFunction<? super T> mapper)
public static <T> Collector<T,?,IntSummaryStatistics> summarizingInt(ToIntFunction<? super T> mapper)
public static <T> Collector<T,?,LongSummaryStatistics> summarizingLong(ToLongFunction<? super T> mapper)
public static <T> Collector<T,?,com.landawn.abacus.util.FloatSummaryStatistics> summarizingFloat(ToFloatFunction<? super T> mapper)
public static <T> Collector<T,?,DoubleSummaryStatistics> summarizingDouble(ToDoubleFunction<? super T> mapper)
public static <T> Collector<T,?,T> reducing(T identity, BinaryOperator<T> op)
public static <T> Collector<T,?,u.Optional<T>> reducing(BinaryOperator<T> op)
public static <T> Collector<T,?,T> reducingOrGet(BinaryOperator<T> op, Supplier<? extends T> other)
public static <T,X extends java.lang.RuntimeException> Collector<T,?,T> reducingOrThrow(BinaryOperator<T> op, Supplier<? extends X> exceptionSupplier)
public static <T,U> Collector<T,?,U> reducing(U identity, Function<? super T,? extends U> mapper, BinaryOperator<U> op)
public static <T,U> Collector<T,?,u.Optional<U>> reducing(Function<? super T,? extends U> mapper, BinaryOperator<U> op)
public static <T,U> Collector<T,?,U> reducingOrGet(Function<? super T,? extends U> mapper, BinaryOperator<U> op, Supplier<? extends U> other)
public static <T,U,X extends java.lang.RuntimeException> Collector<T,?,U> reducingOrThrow(Function<? super T,? extends U> mapper, BinaryOperator<U> op, Supplier<? extends X> exceptionSupplier)
public static Collector<java.lang.CharSequence,?,java.lang.String> commonPrefix()
Collector
which computes a common prefix of input
CharSequence
objects returning the result as String
. For
empty input the empty String
is returned.
The returned Collector
handles specially Unicode surrogate pairs:
the returned prefix may end with
Unicode high-surrogate code unit only if it's not succeeded by
Unicode low-surrogate code unit in any of the input sequences.
Normally the ending high-surrogate code unit is removed from the prefix.
This method returns a short-circuiting collector: it may not process all the elements if the common prefix is empty.
Collector
which computes a common prefix.public static Collector<java.lang.CharSequence,?,java.lang.String> commonSuffix()
Collector
which computes a common suffix of input
CharSequence
objects returning the result as String
. For
empty input the empty String
is returned.
The returned Collector
handles specially Unicode surrogate pairs:
the returned suffix may start with
Unicode low-surrogate code unit only if it's not preceded by
Unicode high-surrogate code unit in any of the input sequences.
Normally the starting low-surrogate code unit is removed from the suffix.
This method returns a short-circuiting collector: it may not process all the elements if the common suffix is empty.
Collector
which computes a common suffix.public static <T,K> Collector<T,?,java.util.Map<K,java.util.List<T>>> groupingBy(Function<? super T,? extends K> keyMapper)
public static <T,K,M extends java.util.Map<K,java.util.List<T>>> Collector<T,?,M> groupingBy(Function<? super T,? extends K> keyMapper, Supplier<? extends M> mapFactory)
public static <T,K,A,D> Collector<T,?,java.util.Map<K,D>> groupingBy(Function<? super T,? extends K> keyMapper, Collector<? super T,A,D> downstream)
public static <T,K,A,D,M extends java.util.Map<K,D>> Collector<T,?,M> groupingBy(Function<? super T,? extends K> keyMapper, Collector<? super T,A,D> downstream, Supplier<? extends M> mapFactory)
public static <T,K> Collector<T,?,java.util.concurrent.ConcurrentMap<K,java.util.List<T>>> groupingByConcurrent(Function<? super T,? extends K> keyMapper)
public static <T,K,M extends java.util.concurrent.ConcurrentMap<K,java.util.List<T>>> Collector<T,?,M> groupingByConcurrent(Function<? super T,? extends K> keyMapper, Supplier<? extends M> mapFactory)
public static <T,K,A,D> Collector<T,?,java.util.concurrent.ConcurrentMap<K,D>> groupingByConcurrent(Function<? super T,? extends K> keyMapper, Collector<? super T,A,D> downstream)
public static <T,K,A,D,M extends java.util.concurrent.ConcurrentMap<K,D>> Collector<T,?,M> groupingByConcurrent(Function<? super T,? extends K> keyMapper, Collector<? super T,A,D> downstream, Supplier<? extends M> mapFactory)
public static <T> Collector<T,?,java.util.Map<java.lang.Boolean,java.util.List<T>>> partitioningBy(Predicate<? super T> predicate)
public static <T,D,A> Collector<T,?,java.util.Map<java.lang.Boolean,D>> partitioningBy(Predicate<? super T> predicate, Collector<? super T,A,D> downstream)
public static <K,V> Collector<java.util.Map.Entry<K,V>,?,java.util.Map<K,V>> toMap()
public static <K,V> Collector<java.util.Map.Entry<K,V>,?,java.util.Map<K,V>> toMap(BinaryOperator<V> mergeFunction)
public static <K,V,M extends java.util.Map<K,V>> Collector<java.util.Map.Entry<K,V>,?,M> toMap(Supplier<? extends M> mapFactory)
public static <K,V,M extends java.util.Map<K,V>> Collector<java.util.Map.Entry<K,V>,?,M> toMap(BinaryOperator<V> mergeFunction, Supplier<? extends M> mapFactory)
public static <T,K,V> Collector<T,?,java.util.Map<K,V>> toMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends V> valueMapper)
public static <T,K,V> Collector<T,?,java.util.Map<K,V>> toMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends V> valueMapper, BinaryOperator<V> mergeFunction)
public static <T,K,V,M extends java.util.Map<K,V>> Collector<T,?,M> toMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends V> valueMapper, Supplier<? extends M> mapFactory)
public static <T,K,V,M extends java.util.Map<K,V>> Collector<T,?,M> toMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends V> valueMapper, BinaryOperator<V> mergeFunction, Supplier<? extends M> mapFactory)
public static <T,K,A,D> Collector<T,?,java.util.Map<K,D>> toMap(Function<? super T,? extends K> keyMapper, Collector<? super T,A,D> downstream)
keyMapper
- downstream
- groupingBy(Function, Collector)
public static <T,K,A,D,M extends java.util.Map<K,D>> Collector<T,?,M> toMap(Function<? super T,? extends K> keyMapper, Collector<? super T,A,D> downstream, Supplier<? extends M> mapFactory)
keyMapper
- downstream
- mapFactory
- groupingBy(Function, Collector, Supplier)
public static <T,K,V,A,D> Collector<T,?,java.util.Map<K,D>> toMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends V> valueMapper, Collector<? super V,A,D> downstream)
keyMapper
- valueMapper
- downstream
- groupingBy(Function, Collector)
public static <T,K,V,A,D,M extends java.util.Map<K,D>> Collector<T,?,M> toMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends V> valueMapper, Collector<? super V,A,D> downstream, Supplier<? extends M> mapFactory)
keyMapper
- valueMapper
- downstream
- mapFactory
- groupingBy(Function, Collector, Supplier)
public static <K,V> Collector<java.util.Map.Entry<K,V>,?,ImmutableMap<K,V>> toImmutableMap()
public static <K,V> Collector<java.util.Map.Entry<K,V>,?,ImmutableMap<K,V>> toImmutableMap(BinaryOperator<V> mergeFunction)
public static <T,K,V> Collector<T,?,ImmutableMap<K,V>> toImmutableMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends V> valueMapper)
public static <T,K,V> Collector<T,?,ImmutableMap<K,V>> toImmutableMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends V> valueMapper, BinaryOperator<V> mergeFunction)
public static <T,K,V> Collector<T,?,java.util.LinkedHashMap<K,V>> toLinkedHashMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends V> valueMapper)
keyMapper
- valueMapper
- toMap(Function, Function)
public static <T,K,V> Collector<T,?,java.util.LinkedHashMap<K,V>> toLinkedHashMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends V> valueMapper, BinaryOperator<V> mergeFunction)
keyMapper
- valueMapper
- mergeFunction
- toMap(Function, Function, BinaryOperator)
public static <T,K,V> Collector<T,?,java.util.concurrent.ConcurrentMap<K,V>> toConcurrentMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends V> valueMapper)
public static <T,K,V,M extends java.util.concurrent.ConcurrentMap<K,V>> Collector<T,?,M> toConcurrentMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends V> valueMapper, Supplier<? extends M> mapFactory)
public static <T,K,V> Collector<T,?,java.util.concurrent.ConcurrentMap<K,V>> toConcurrentMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends V> valueMapper, BinaryOperator<V> mergeFunction)
public static <T,K,V,M extends java.util.concurrent.ConcurrentMap<K,V>> Collector<T,?,M> toConcurrentMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends V> valueMapper, BinaryOperator<V> mergeFunction, Supplier<? extends M> mapFactory)
public static <T,K,V> Collector<T,?,BiMap<K,V>> toBiMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends V> valueMapper)
public static <T,K,V> Collector<T,?,BiMap<K,V>> toBiMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends V> valueMapper, Supplier<BiMap<K,V>> mapFactory)
public static <T,K,V> Collector<T,?,BiMap<K,V>> toBiMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends V> valueMapper, BinaryOperator<V> mergeFunction)
public static <T,K,V> Collector<T,?,BiMap<K,V>> toBiMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends V> valueMapper, BinaryOperator<V> mergeFunction, Supplier<BiMap<K,V>> mapFactory)
public static <K,V> Collector<java.util.Map.Entry<? extends K,? extends V>,?,ListMultimap<K,V>> toMultimap()
public static <K,V,C extends java.util.Collection<V>,M extends Multimap<K,V,C>> Collector<java.util.Map.Entry<? extends K,? extends V>,?,M> toMultimap(Supplier<? extends M> mapFactory)
public static <T,K> Collector<T,?,ListMultimap<K,T>> toMultimap(Function<? super T,? extends K> keyMapper)
public static <T,K,C extends java.util.Collection<T>,M extends Multimap<K,T,C>> Collector<T,?,M> toMultimap(Function<? super T,? extends K> keyMapper, Supplier<? extends M> mapFactory)
public static <T,K,V> Collector<T,?,ListMultimap<K,V>> toMultimap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends V> valueMapper)
public static <T,K,V,C extends java.util.Collection<V>,M extends Multimap<K,V,C>> Collector<T,?,M> toMultimap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends V> valueMapper, Supplier<? extends M> mapFactory)
public static <T> Collector<T,?,DataSet> toDataSet(java.util.List<java.lang.String> columnNames)
public static <T,A1,A2,R1,R2> Collector<T,Tuple.Tuple2<A1,A2>,Tuple.Tuple2<R1,R2>> combine(Collector<? super T,A1,R1> collector1, Collector<? super T,A2,R2> collector2)
public static <T,A1,A2,R1,R2,R> Collector<T,Tuple.Tuple2<A1,A2>,R> combine(Collector<? super T,A1,R1> collector1, Collector<? super T,A2,R2> collector2, BiFunction<? super R1,? super R2,R> finisher)
public static <T,A1,A2,A3,R1,R2,R3> Collector<T,Tuple.Tuple3<A1,A2,A3>,Tuple.Tuple3<R1,R2,R3>> combine(Collector<? super T,A1,R1> collector1, Collector<? super T,A2,R2> collector2, Collector<? super T,A3,R3> collector3)
public static <T,A1,A2,A3,R1,R2,R3,R> Collector<T,Tuple.Tuple3<A1,A2,A3>,R> combine(Collector<? super T,A1,R1> collector1, Collector<? super T,A2,R2> collector2, Collector<? super T,A3,R3> collector3, TriFunction<? super R1,? super R2,? super R3,R> finisher)
public static <T,A1,A2,A3,A4,R1,R2,R3,R4> Collector<T,Tuple.Tuple4<A1,A2,A3,A4>,Tuple.Tuple4<R1,R2,R3,R4>> combine(Collector<? super T,A1,R1> collector1, Collector<? super T,A2,R2> collector2, Collector<? super T,A3,R3> collector3, Collector<? super T,A4,R4> collector4)
public static <T,A1,A2,A3,A4,A5,R1,R2,R3,R4,R5> Collector<T,Tuple.Tuple5<A1,A2,A3,A4,A5>,Tuple.Tuple5<R1,R2,R3,R4,R5>> combine(Collector<? super T,A1,R1> collector1, Collector<? super T,A2,R2> collector2, Collector<? super T,A3,R3> collector3, Collector<? super T,A4,R4> collector4, Collector<? super T,A5,R5> collector5)
public static <T> Collector<T,?,java.util.List<?>> combine(java.util.List<? extends Collector<? super T,?,?>> collectors)
collectors
- Tuple.from(Collection)
public static <T,A1,A2,R1,R2> Collector<T,Tuple.Tuple2<A1,A2>,Tuple.Tuple2<R1,R2>> combine(java.util.stream.Collector<? super T,A1,R1> collector1, java.util.stream.Collector<? super T,A2,R2> collector2)
public static <T,A1,A2,R1,R2,R> Collector<T,Tuple.Tuple2<A1,A2>,R> combine(java.util.stream.Collector<? super T,A1,R1> collector1, java.util.stream.Collector<? super T,A2,R2> collector2, java.util.function.BiFunction<? super R1,? super R2,R> finisher)
public static <T,A1,A2,A3,R1,R2,R3> Collector<T,Tuple.Tuple3<A1,A2,A3>,Tuple.Tuple3<R1,R2,R3>> combine(java.util.stream.Collector<? super T,A1,R1> collector1, java.util.stream.Collector<? super T,A2,R2> collector2, java.util.stream.Collector<? super T,A3,R3> collector3)
public static <T,A1,A2,A3,R1,R2,R3,R> Collector<T,Tuple.Tuple3<A1,A2,A3>,R> combine(java.util.stream.Collector<? super T,A1,R1> collector1, java.util.stream.Collector<? super T,A2,R2> collector2, java.util.stream.Collector<? super T,A3,R3> collector3, TriFunction<? super R1,? super R2,? super R3,R> finisher)
public static <T,A1,A2,A3,A4,R1,R2,R3,R4> Collector<T,Tuple.Tuple4<A1,A2,A3,A4>,Tuple.Tuple4<R1,R2,R3,R4>> combine(java.util.stream.Collector<? super T,A1,R1> collector1, java.util.stream.Collector<? super T,A2,R2> collector2, java.util.stream.Collector<? super T,A3,R3> collector3, java.util.stream.Collector<? super T,A4,R4> collector4)
public static <T,A1,A2,A3,A4,A5,R1,R2,R3,R4,R5> Collector<T,Tuple.Tuple5<A1,A2,A3,A4,A5>,Tuple.Tuple5<R1,R2,R3,R4,R5>> combine(java.util.stream.Collector<? super T,A1,R1> collector1, java.util.stream.Collector<? super T,A2,R2> collector2, java.util.stream.Collector<? super T,A3,R3> collector3, java.util.stream.Collector<? super T,A4,R4> collector4, java.util.stream.Collector<? super T,A5,R5> collector5)
public static <T> Collector<T,?,java.util.List<?>> combine(java.util.Collection<? extends java.util.stream.Collector<? super T,?,?>> collectors)
collectors
- Tuple.from(Collection)
public static <T,R> Collector<T,?,R> streaming(Function<? super Stream<T>,R> streamingCollector)
Collectors
.streamingCollector
- Stream#observe(BlockingQueue, Predicate, long)
,
Stream.asyncCall(Try.Function)
public static <T,R> Collector<T,?,R> streaming(long maxWaitIntervalInMillis, Function<? super Stream<T>,R> streamingCollector)
Collectors
.maxWaitIntervalInMillis
- streamingCollector
- Stream#observe(BlockingQueue, Predicate, long)
,
Stream.asyncCall(Try.Function)
public static <T,R> Collector<T,?,R> streaming(Supplier<? extends java.util.concurrent.BlockingQueue<T>> queueSupplier, Function<? super Stream<T>,R> streamingCollector)
Collectors
.supplier
- streamingCollector
- Stream#observe(BlockingQueue, Predicate, long)
,
Stream.asyncCall(Try.Function)
public static <T,R> Collector<T,?,R> streaming(long maxWaitIntervalInMillis, Supplier<? extends java.util.concurrent.BlockingQueue<T>> queueSupplier, Function<? super Stream<T>,R> streamingCollector)
Collectors
.maxWaitIntervalInMillis
- supplier
- streamingCollector
- Stream#observe(BlockingQueue, Predicate, long)
,
Stream.asyncCall(Try.Function)
public static <T,R> Collector<T,?,R> streaming(Supplier<? extends java.util.concurrent.BlockingQueue<T>> queueSupplier, Function<? super Stream<T>,ContinuableFuture<R>> streamingCollector, long maxWaitIntervalInMillis)
Collectors
.supplier
- streamingCollector
- maxWaitIntervalInMillis
- Stream#observe(BlockingQueue, Predicate, long)
,
Stream.asyncCall(Try.Function)