| 软件包 | 描述 |
|---|---|
| java.util.stream |
类,以支持元素流上的功能样式操作,如Map减少集合上的转换。
|
| Modifier and Type | Method and Description |
|---|---|
static <T> Collector<T,?,Double> |
Collectors.averagingDouble(ToDoubleFunction<? super T> mapper)
返回一个
Collector产生一个双值函数应用于输入元素的算术平均值。
|
static <T> Collector<T,?,Double> |
Collectors.averagingInt(ToIntFunction<? super T> mapper)
返回一个
Collector产生一个整数的值函数应用于输入元素的算术平均值。
|
static <T> Collector<T,?,Double> |
Collectors.averagingLong(ToLongFunction<? super T> mapper)
返回一个
Collector生产长值函数应用于输入元素的算术平均值。
|
static <T,A,R,RR> Collector<T,A,RR> |
Collectors.collectingAndThen(Collector<T,A,R> downstream, Function<R,RR> finisher)
适应
Collector执行一个额外的加工转化。
|
static <T> Collector<T,?,Long> |
Collectors.counting()
返回一个
Collector接受型
T计数输入元素个数的元素。
|
static <T,K> Collector<T,?,Map<K,List<T>>> |
Collectors.groupingBy(Function<? super T,? extends K> classifier)
返回一个
Collector实行“组”操作的输入元素类型
T,分组元素按一个分类函数,返回的结果在
Map。
|
static <T,K,A,D> Collector<T,?,Map<K,D>> |
Collectors.groupingBy(Function<? super T,? extends K> classifier, Collector<? super T,A,D> downstream)
返回一个实现级联的“组”操作
Collector
T型输入元素,元素分组根据分类功能,然后执行还原操作对一个给定的键使用指定的下游
Collector关联的值。
|
static <T,K,D,A,M extends Map<K,D>> |
Collectors.groupingBy(Function<? super T,? extends K> classifier, Supplier<M> mapFactory, Collector<? super T,A,D> downstream)
返回一个实现级联的“组”操作
Collector
T型输入元素,元素分组根据分类功能,然后执行还原操作对一个给定的键使用指定的下游
Collector关联的值。
|
static <T,K> Collector<T,?,ConcurrentMap<K,List<T>>> |
Collectors.groupingByConcurrent(Function<? super T,? extends K> classifier)
返回一个并发
Collector实行“组”操作的输入元素类型
T,分组元素按照分类功能。
|
static <T,K,A,D> Collector<T,?,ConcurrentMap<K,D>> |
Collectors.groupingByConcurrent(Function<? super T,? extends K> classifier, Collector<? super T,A,D> downstream)
返回一个
Collector实施并行级联”组的“
T型要素投入运作,分组元素按一个分类函数,然后执行还原操作对一个给定的键使用指定的下游
Collector关联的值。
|
static <T,K,A,D,M extends ConcurrentMap<K,D>> |
Collectors.groupingByConcurrent(Function<? super T,? extends K> classifier, Supplier<M> mapFactory, Collector<? super T,A,D> downstream)
返回一个
Collector实施并行级联”组的“
T型要素投入运作,分组元素按一个分类函数,然后执行还原操作对一个给定的键使用指定的下游
Collector关联的值。
|
static Collector<CharSequence,?,String> |
Collectors.joining()
返回一个
Collector,输入元素到一个
String,在遭遇订单。
|
static Collector<CharSequence,?,String> |
Collectors.joining(CharSequence delimiter)
返回一个
Collector,输入元素,以指定的分隔符分隔,在遭遇订单。
|
static Collector<CharSequence,?,String> |
Collectors.joining(CharSequence delimiter, CharSequence prefix, CharSequence suffix)
返回一个
Collector,输入元素,以指定的分隔符分隔,用指定的前缀和后缀,在遭遇订单。
|
static <T,U,A,R> Collector<T,?,R> |
Collectors.mapping(Function<? super T,? extends U> mapper, Collector<? super U,A,R> downstream)
适应
Collector接受型
U元素之一接受元素类型
T应用映射功能,每个输入元素之前的积累。
|
static <T> Collector<T,?,Optional<T>> |
Collectors.maxBy(Comparator<? super T> comparator)
返回一个
Collector产生极大元根据给定的
Comparator,描述为一个
Optional<T>。
|
static <T> Collector<T,?,Optional<T>> |
Collectors.minBy(Comparator<? super T> comparator)
返回一个
Collector产生最小的元素按照一定的
Comparator,描述为一个
Optional<T>。
|
static <T,A,R> Collector<T,A,R> |
Collector.of(Supplier<A> supplier, BiConsumer<A,T> accumulator, BinaryOperator<A> combiner, Function<A,R> finisher, Collector.Characteristics... characteristics)
返回一个新的
Collector描述给定的
supplier,
accumulator,
combiner,和
finisher功能。
|
static <T,R> Collector<T,R,R> |
Collector.of(Supplier<R> supplier, BiConsumer<R,T> accumulator, BinaryOperator<R> combiner, Collector.Characteristics... characteristics)
返回一个新的
Collector由给定的
supplier,
accumulator描述,和
combiner功能。
|
static <T> Collector<T,?,Map<Boolean,List<T>>> |
Collectors.partitioningBy(Predicate<? super T> predicate)
返回一个
Collector分区根据
Predicate输入元素,并将它们组织成一个
Map<Boolean, List<T>>。
|
static <T,D,A> Collector<T,?,Map<Boolean,D>> |
Collectors.partitioningBy(Predicate<? super T> predicate, Collector<? super T,A,D> downstream)
返回一个
Collector分区的输入元素,根据
Predicate,降低值在每个分区根据另一
Collector,并将它们组织成一个
Map<Boolean, D>其值是下游减少的结果。
|
static <T> Collector<T,?,Optional<T>> |
Collectors.reducing(BinaryOperator<T> op)
返回一个
Collector执行指定的
BinaryOperator下减少其投入要素。
|
static <T> Collector<T,?,T> |
Collectors.reducing(T identity, BinaryOperator<T> op)
返回一个
Collector执行指定的
BinaryOperator下使用提供的身份的输入元素的减少。
|
static <T,U> Collector<T,?,U> |
Collectors.reducing(U identity, Function<? super T,? extends U> mapper, BinaryOperator<U> op)
返回一个
Collector执行指定的映射功能和
BinaryOperator下减少其投入要素。
|
static <T> Collector<T,?,DoubleSummaryStatistics> |
Collectors.summarizingDouble(ToDoubleFunction<? super T> mapper)
返回一个
Collector采用
double-producing映射功能,每个输入元素,并返回结果值汇总统计。
|
static <T> Collector<T,?,IntSummaryStatistics> |
Collectors.summarizingInt(ToIntFunction<? super T> mapper)
返回一个
Collector采用
int-producing映射功能,每个输入元素,并返回结果值汇总统计。
|
static <T> Collector<T,?,LongSummaryStatistics> |
Collectors.summarizingLong(ToLongFunction<? super T> mapper)
返回一个
Collector采用
long-producing映射功能,每个输入元素,并返回结果值汇总统计。
|
static <T> Collector<T,?,Double> |
Collectors.summingDouble(ToDoubleFunction<? super T> mapper)
返回一个
Collector产生一个双值函数应用于投入要素的总和。
|
static <T> Collector<T,?,Integer> |
Collectors.summingInt(ToIntFunction<? super T> mapper)
返回一个
Collector产生一个整数的函数应用于输入元素的总和。
|
static <T> Collector<T,?,Long> |
Collectors.summingLong(ToLongFunction<? super T> mapper)
返回一个
Collector生产长值函数应用于投入要素的总和。
|
static <T,C extends Collection<T>> |
Collectors.toCollection(Supplier<C> collectionFactory)
返回一个
Collector积累输入元素到一个新的
Collection,在遭遇订单。
|
static <T,K,U> Collector<T,?,ConcurrentMap<K,U>> |
Collectors.toConcurrentMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends U> valueMapper)
返回一个并发
Collector积累成
ConcurrentMap元素的键和值是应用提供的函数映射到输入元素的结果。
|
static <T,K,U> Collector<T,?,ConcurrentMap<K,U>> |
Collectors.toConcurrentMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends U> valueMapper, BinaryOperator<U> mergeFunction)
返回一个并发
Collector积累成
ConcurrentMap元素的键和值是应用提供的函数映射到输入元素的结果。
|
static <T,K,U,M extends ConcurrentMap<K,U>> |
Collectors.toConcurrentMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends U> valueMapper, BinaryOperator<U> mergeFunction, Supplier<M> mapSupplier)
返回一个并发
Collector积累成
ConcurrentMap元素的键和值是应用提供的函数映射到输入元素的结果。
|
static <T> Collector<T,?,List<T>> |
Collectors.toList()
返回一个
Collector积累输入元素到一个新的
List。
|
static <T,K,U> Collector<T,?,Map<K,U>> |
Collectors.toMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends U> valueMapper)
返回一个
Collector积累成一个
Map元素的键和值是应用提供的函数映射到输入元素的结果。
|
static <T,K,U> Collector<T,?,Map<K,U>> |
Collectors.toMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends U> valueMapper, BinaryOperator<U> mergeFunction)
返回一个
Collector积累成一个
Map元素的键和值是应用提供的函数映射到输入元素的结果。
|
static <T,K,U,M extends Map<K,U>> |
Collectors.toMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends U> valueMapper, BinaryOperator<U> mergeFunction, Supplier<M> mapSupplier)
返回一个
Collector积累成一个
Map元素的键和值是应用提供的函数映射到输入元素的结果。
|
static <T> Collector<T,?,Set<T>> |
Collectors.toSet()
返回一个
Collector积累输入元素到一个新的
Set。
|
| Modifier and Type | Method and Description |
|---|---|
<R,A> R |
Stream.collect(Collector<? super T,A,R> collector)
执行
mutable reduction操作对元素的使用
Collector流。
|
static <T,A,R,RR> Collector<T,A,RR> |
Collectors.collectingAndThen(Collector<T,A,R> downstream, Function<R,RR> finisher)
适应
Collector执行一个额外的加工转化。
|
static <T,K,A,D> Collector<T,?,Map<K,D>> |
Collectors.groupingBy(Function<? super T,? extends K> classifier, Collector<? super T,A,D> downstream)
返回一个实现级联的“组”操作
Collector
T型输入元素,元素分组根据分类功能,然后执行还原操作对一个给定的键使用指定的下游
Collector关联的值。
|
static <T,K,D,A,M extends Map<K,D>> |
Collectors.groupingBy(Function<? super T,? extends K> classifier, Supplier<M> mapFactory, Collector<? super T,A,D> downstream)
返回一个实现级联的“组”操作
Collector
T型输入元素,元素分组根据分类功能,然后执行还原操作对一个给定的键使用指定的下游
Collector关联的值。
|
static <T,K,A,D> Collector<T,?,ConcurrentMap<K,D>> |
Collectors.groupingByConcurrent(Function<? super T,? extends K> classifier, Collector<? super T,A,D> downstream)
返回一个
Collector实施并行级联”组的“
T型要素投入运作,分组元素按一个分类函数,然后执行还原操作对一个给定的键使用指定的下游
Collector关联的值。
|
static <T,K,A,D,M extends ConcurrentMap<K,D>> |
Collectors.groupingByConcurrent(Function<? super T,? extends K> classifier, Supplier<M> mapFactory, Collector<? super T,A,D> downstream)
返回一个
Collector实施并行级联”组的“
T型要素投入运作,分组元素按一个分类函数,然后执行还原操作对一个给定的键使用指定的下游
Collector关联的值。
|
static <T,U,A,R> Collector<T,?,R> |
Collectors.mapping(Function<? super T,? extends U> mapper, Collector<? super U,A,R> downstream)
适应
Collector接受型
U元素之一接受元素类型
T应用映射功能,每个输入元素之前的积累。
|
static <T,D,A> Collector<T,?,Map<Boolean,D>> |
Collectors.partitioningBy(Predicate<? super T> predicate, Collector<? super T,A,D> downstream)
返回一个
Collector分区的输入元素,根据
Predicate,降低值在每个分区根据另一
Collector,并将它们组织成一个
Map<Boolean, D>其值是下游减少的结果。
|
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.