java.util.stream.Collectors
| 修饰符和类型 | 方法 | 描述 |
|---|---|---|
| static | averagingDouble(ToDoubleFunction super T> mapper) | 返回求输入Double类型元素平均值的Collector |
| static | averagingInt(ToIntFunction super T> mapper) | 返回求输入Interger类型元素平均值的Collector |
| static | averagingLong(ToLongFunction super T> mapper) | 返回求输入Long类型元素平均值的Collector |
| static Collector | collectingAndThen(Collector | 调整收集器在完成收集后应用额外的转换逻辑 |
| static | counting() | 返回一个接受T类型元素的Collector,用于统计T元素的个数 |
| static Collector | filtering(Predicate super T> predicate, Collector super T,A,R> downstream) | 通过对每个输入元素应用Predicate,使收集器适应于一个接受相同类型T的元素,并只在Predicate返回true时进行累积。 |
| static Collector | flatMapping(Function super T,? extends Stream extends U>> mapper,Collector super U,A,R> downstream) | 通过在累积之前对每个输入元素应用Function映射函数,将一个接受U类型元素的收集器调整为一个接受T类型元素。 |
| static Collector | groupingBy(Function super T,? extends K> classifier) | Returns a Collector implementing a "group by" operation on input elements of type T, grouping elements according to a classification function, and returning the results in a Map. |
| static Collector | groupingBy(Function super T,? extends K> classifier,Supplier | Returns a Collector implementing a cascaded "group by" operation on input elements of type T, grouping elements according to a classification function, and then performing a reduction operation on the values associated with a given key using the specified downstream Collector. |
| static Collector | groupingBy(Function super T,? extends K> classifier, Collector super T,A,D> downstream) | Returns a Collector implementing a cascaded "group by" operation on input elements of type T, grouping elements according to a classification function, and then performing a reduction operation on the values associated with a given key using the specified downstream Collector. |
| static Collector | groupingByConcurrent(Function super T,? extends K> classifier) | Returns a concurrent Collector implementing a "group by" operation on input elements of type T, grouping elements according to a classification function. |
| static Collector | groupingByConcurrent(Function super T,? extends K> classifier,Supplier | Returns a concurrent Collector implementing a cascaded "group by" operation on input elements of type T, grouping elements according to a classification function, and then performing a reduction operation on the values associated with a given key using the specified downstream Collector. |
| static Collector | groupingByConcurrent(Function super T,? extends K> classifier,Collector super T,A,D> downstream) | Returns a concurrent Collector implementing a cascaded "group by" operation on input elements of type T, grouping elements according to a classification function, and then performing a reduction operation on the values associated with a given key using the specified downstream Collector. |
| staticCollector | joining() | Returns a Collector that concatenates the input elements into a String, in encounter order. |
| staticCollector | joining(CharSequence delimiter) | Returns a Collector that concatenates the input elements, separated by the specified delimiter, in encounter order. |
| staticCollector | joining(CharSequence delimiter, CharSequence prefix,CharSequence suffix) | Returns a Collector that concatenates the input elements, separated by the specified delimiter, with the specified prefix and suffix, in encounter order. |
| static Collector | mapping(Function super T,? extends U> mapper, Collector super U,A,R> downstream) | Adapts a Collector accepting elements of type U to one accepting elements of type T by applying a mapping function to each input element before accumulation. |
| static | maxBy(Comparator super T> comparator) | Returns a Collector that produces the maximal element according to a given Comparator, described as an Optional |
| static | minBy(Comparator super T> comparator) | Returns a Collector that produces the minimal element according to a given Comparator, described as an Optional |
| static | partitioningBy(Predicate super T> predicate) | Returns a Collector which partitions the input elements according to a Predicate, and organizes them into a Map |
| static Collector | partitioningBy(Predicate super T> predicate, Collector super T,A,D> downstream) | Returns a Collector which partitions the input elements according to a Predicate, reduces the values in each partition according to another Collector, and organizes them into a Map |
| static | reducing(BinaryOperator | Returns a Collector which performs a reduction of its input elements under a specified BinaryOperator. |
| static | reducing(T identity, BinaryOperator | Returns a Collector which performs a reduction of its input elements under a specified BinaryOperator using the provided identity. |
| static Collector | reducing(U identity, Function super T,? extends U> mapper,BinaryOperator op) | Returns a Collector which performs a reduction of its input elements under a specified mapping function and BinaryOperator. |
| static | summarizingDouble(ToDoubleFunction super T> mapper) | Returns a Collector which applies an double-producing mapping function to each input element, and returns summary statistics for the resulting values. |
| static | summarizingInt(ToIntFunction super T> mapper) | Returns a Collector which applies an int-producing mapping function to each input element, and returns summary statistics for the resulting values. |
| static | summarizingLong(ToLongFunction super T> mapper) | Returns a Collector which applies an long-producing mapping function to each input element, and returns summary statistics for the resulting values. |
| static | summingDouble(ToDoubleFunction super T> mapper) | Returns a Collector that produces the sum of a double-valued function applied to the input elements. |
| static | summingInt(ToIntFunction super T> mapper) | Returns a Collector that produces the sum of a integer-valued function applied to the input elements. |
| static | summingLong(ToLongFunction super T> mapper) | Returns a Collector that produces the sum of a long-valued function applied to the input elements. |
| static Collector | toCollection(Supplier | Returns a Collector that accumulates the input elements into a new Collection, in encounter order. |
| static Collector | toConcurrentMap(Function super T,? extends K> keyMapper, Function super T,? extends U> valueMapper) | Returns a concurrent Collector that accumulates elements into a ConcurrentMap whose keys and values are the result of applying the provided mapping functions to the input elements. |
| static Collector | toConcurrentMap(Function super T,? extends K> keyMapper, Function super T,? extends U> valueMapper, BinaryOperator mergeFunction) | Returns a concurrent Collector that accumulates elements into a ConcurrentMap whose keys and values are the result of applying the provided mapping functions to the input elements. |
| static Collector | toConcurrentMap(Function super T,? extends K> keyMapper, Function super T,? extends U> valueMapper, BinaryOperator mergeFunction,Supplier | Returns a concurrent Collector that accumulates elements into a ConcurrentMap whose keys and values are the result of applying the provided mapping functions to the input elements. |
| static | toList() | Returns a Collector that accumulates the input elements into a new List. |
| static Collector | toMap(Function super T,? extends K> keyMapper, Function super T,? extends U> valueMapper) | Returns a Collector that accumulates elements into a Map whose keys and values are the result of applying the provided mapping functions to the input elements. |
| static Collector | toMap(Function super T,? extends K> keyMapper, Function super T,? extends U> valueMapper, BinaryOperator mergeFunction) | Returns a Collector that accumulates elements into a Map whose keys and values are the result of applying the provided mapping functions to the input elements. |
| static Collector | toMap(Function super T,? extends K> keyMapper, Function super T,? extends U> valueMapper, BinaryOperator mergeFunction,Supplier | Returns a Collector that accumulates elements into a Map whose keys and values are the result of applying the provided mapping functions to the input elements. |
| static | toSet() | Returns a Collector that accumulates the input elements into a new Set. |
| static | toUnmodifiableList() | Returns a Collector that accumulates the input elements into an unmodifiable List in encounter order. |
| static Collector | toUnmodifiableMap(Function super T,? extends K> keyMapper, Function super T,? extends U> valueMapper) | Returns a Collector that accumulates the input elements into an unmodifiable Map, whose keys and values are the result of applying the provided mapping functions to the input elements. |
| static Collector | toUnmodifiableMap(Function super T,? extends K> keyMapper, Function super T,? extends U> valueMapper, BinaryOperator mergeFunction) | Returns a Collector that accumulates the input elements into an unmodifiable Map, whose keys and values are the result of applying the provided mapping functions to the input elements. |
| static | toUnmodifiableSet() | Returns a Collector that accumulates the input elements into an unmodifiable Set. |



