代码改变世界

java.util.stream.Collectors

2021-05-15 18:46  Spiderman25  阅读(159)  评论(0)    收藏  举报

public static Collector averagingDouble(ToDoubleFunction arg0)//接收double求平均数
public static Collector averagingInt(ToIntFunction arg0)//接收int求平均数
public static Collector averagingLong(ToLongFunction arg0)//接收long求平均数
public static Collector collectingAndThen(Collector arg0,Function arg1)//arg0聚集,第二个接收arg0的聚集返回元素
public static Collector counting()//统计数量
public static Collector groupingBy(Function arg0,Supplier arg1,Collector arg2)//第一个参数是以什么分类,第二个是容器提供者,第三个参数继续聚集
public static Collector groupingBy(Function arg0,Collector arg1)//第一个参数是以什么分类,第二个参数继续聚集
public static Collector groupingBy(Function arg0)//以什么分类
public static Collector groupingByConcurrent(Function arg0,Supplier arg1,Collector arg2)
public static Collector groupingByConcurrent(Function arg0,Collector arg1)
public static Collector groupingByConcurrent(Function arg0)
public static Collector joining()//无分隔符合并,字符串时可用
public static Collector joining(CharSequence arg0)//分隔符,字符串时可用
public static Collector joining(CharSequence arg0,CharSequence arg1,CharSequence arg2)//分隔符,前缀,后缀,字符串时可用
public static Collector mapping(Function arg0,Collector arg1)
public static Collector maxBy(Comparator arg0)//求最大值
public static Collector minBy(Comparator arg0)//求最小值
public static Collector partitioningBy(Predicate arg0,Collector arg1)//跟据元素分成两部分,即返回map,value为list,arg1为继续聚集
public static Collector partitioningBy(Predicate arg0)//跟据元素分成两部分,即返回map,value为list
public static Collector reducing(Object arg0,Function arg1,BinaryOperator arg2)
public static Collector reducing(Object arg0,BinaryOperator arg1)
public static Collector reducing(BinaryOperator arg0)
public static Collector summarizingDouble(ToDoubleFunction arg0)//统计,最大、最小、平均、总和、数量
public static Collector summarizingInt(ToIntFunction arg0)//统计,最大、最小、平均、总和、数量
public static Collector summarizingLong(ToLongFunction arg0)//统计,最大、最小、平均、总和、数量
public static Collector summingDouble(ToDoubleFunction arg0)//接收double求和
public static Collector summingInt(ToIntFunction arg0)//接收int求和
public static Collector summingLong(ToLongFunction arg0)//接收long求和
public static Collector toCollection(Supplier arg0)//把元素放在arg0返回的集合中
public static Collector toConcurrentMap(Function arg0,Function arg1,BinaryOperator arg2,Supplier arg3)//跟map一样,只是返回安全的map
public static Collector toConcurrentMap(Function arg0,Function arg1,BinaryOperator arg2)//跟map一样,只是返回安全的map
public static Collector toConcurrentMap(Function arg0,Function arg1)//跟map一样,只是返回安全的map
public static Collector toList()//把元素放在list集合中
public static Collector toMap(Function arg0,Function arg1,BinaryOperator arg2)//把元素转成map,如果key相同,则用arg2选择其中一个,arg2前面的是已存在的,后面的是要加入的
public static Collector toMap(Function arg0,Function arg1)//把元素转成map
public static Collector toMap(Function arg0,Function arg1,BinaryOperator arg2,Supplier arg3)//把元素转成map,arg3为返回特定的map
public static Collector toSet()//把元素放在set集合中

 

 

public static <T> Collector<T, ?, Double> averagingDouble(ToDoubleFunction<? super T> arg0)
public static <T> Collector<T, ?, Double> averagingInt(ToIntFunction<? super T> arg0)
public static <T> Collector<T, ?, Double> averagingLong(ToLongFunction<? super T> arg0)
public static <T,A,R,RR> Collector<T, A, RR> collectingAndThen(Collector<T, A, R> arg0,Function<R, RR> arg1)
public static <T> Collector<T, ?, Long> counting()
public static <T,K,A,D> Collector<T, ?, Map<K, D>> groupingBy(Function<? super T, ? extends K> arg0,Collector<? super T, A, D> arg1)
public static <T,K,D,A,M> Collector<T, ?, M> groupingBy(Function<? super T, ? extends K> arg0,Supplier<M> arg1,Collector<? super T, A, D> arg2)
public static <T,K> Collector<T, ?, Map<K, List<T>>> groupingBy(Function<? super T, ? extends K> arg0)
public static <T,K,A,D,M> Collector<T, ?, M> groupingByConcurrent(Function<? super T, ? extends K> arg0,Supplier<M> arg1,Collector<? super T, A, D> arg2)
public static <T,K,A,D> Collector<T, ?, ConcurrentMap<K, D>> groupingByConcurrent(Function<? super T, ? extends K> arg0,Collector<? super T, A, D> arg1)
public static <T,K> Collector<T, ?, ConcurrentMap<K, List<T>>> groupingByConcurrent(Function<? super T, ? extends K> arg0)
public static Collector<CharSequence, ?, String> joining()
public static Collector<CharSequence, ?, String> joining(CharSequence arg0)
public static Collector<CharSequence, ?, String> joining(CharSequence arg0,CharSequence arg1,CharSequence arg2)
public static <T,U,A,R> Collector<T, ?, R> mapping(Function<? super T, ? extends U> arg0,Collector<? super U, A, R> arg1)
public static <T> Collector<T, ?, Optional<T>> maxBy(Comparator<? super T> arg0)
public static <T> Collector<T, ?, Optional<T>> minBy(Comparator<? super T> arg0)
public static <T,D,A> Collector<T, ?, Map<Boolean, D>> partitioningBy(Predicate<? super T> arg0,Collector<? super T, A, D> arg1)
public static <T> Collector<T, ?, Map<Boolean, List<T>>> partitioningBy(Predicate<? super T> arg0)
public static <T,U> Collector<T, ?, U> reducing(U arg0,Function<? super T, ? extends U> arg1,BinaryOperator<U> arg2)
public static <T> Collector<T, ?, Optional<T>> reducing(BinaryOperator<T> arg0)
public static <T> Collector<T, ?, T> reducing(T arg0,BinaryOperator<T> arg1)
public static <T> Collector<T, ?, DoubleSummaryStatistics> summarizingDouble(ToDoubleFunction<? super T> arg0)
public static <T> Collector<T, ?, IntSummaryStatistics> summarizingInt(ToIntFunction<? super T> arg0)
public static <T> Collector<T, ?, LongSummaryStatistics> summarizingLong(ToLongFunction<? super T> arg0)
public static <T> Collector<T, ?, Double> summingDouble(ToDoubleFunction<? super T> arg0)
public static <T> Collector<T, ?, Integer> summingInt(ToIntFunction<? super T> arg0)
public static <T> Collector<T, ?, Long> summingLong(ToLongFunction<? super T> arg0)
public static <T,C> Collector<T, ?, C> toCollection(Supplier<C> arg0)
public static <T,K,U,M> Collector<T, ?, M> toConcurrentMap(Function<? super T, ? extends K> arg0,Function<? super T, ? extends U> arg1,BinaryOperator<U> arg2,Supplier<M> arg3)
public static <T,K,U> Collector<T, ?, ConcurrentMap<K, U>> toConcurrentMap(Function<? super T, ? extends K> arg0,Function<? super T, ? extends U> arg1)
public static <T,K,U> Collector<T, ?, ConcurrentMap<K, U>> toConcurrentMap(Function<? super T, ? extends K> arg0,Function<? super T, ? extends U> arg1,BinaryOperator<U> arg2)
public static <T> Collector<T, ?, List<T>> toList()
public static <T,K,U,M> Collector<T, ?, M> toMap(Function<? super T, ? extends K> arg0,Function<? super T, ? extends U> arg1,BinaryOperator<U> arg2,Supplier<M> arg3)
public static <T,K,U> Collector<T, ?, Map<K, U>> toMap(Function<? super T, ? extends K> arg0,Function<? super T, ? extends U> arg1)
public static <T,K,U> Collector<T, ?, Map<K, U>> toMap(Function<? super T, ? extends K> arg0,Function<? super T, ? extends U> arg1,BinaryOperator<U> arg2)
public static <T> Collector<T, ?, Set<T>> toSet()