Spec-Zone .ru
спецификации, руководства, описания, API
|
Package | Description |
---|---|
java.util.stream |
java.util.stream
|
Modifier and Type | Method and Description |
---|---|
static <T> Collector<T,Long> |
Collectors.counting()
Returns a
Collector<T, Long> that counts the number of input
elements. |
static <T,K> Collector<T,Map<K,List<T>>> |
Collectors.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. |
static <T,K,D> Collector<T,Map<K,D>> |
Collectors.groupingBy(Function<? super T,? extends K> classifier,
Collector<? super T,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 <T,K,D,M extends Map<K,D>> |
Collectors.groupingBy(Function<? super T,? extends K> classifier,
Supplier<M> mapFactory,
Collector<? super T,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 <T,K> Collector<T,ConcurrentMap<K,List<T>>> |
Collectors.groupingByConcurrent(Function<? super T,? extends K> classifier)
Returns a
Collector implementing a concurrent "group by"
operation on input elements of type T , grouping elements
according to a classification function. |
static <T,K,D> Collector<T,ConcurrentMap<K,D>> |
Collectors.groupingByConcurrent(Function<? super T,? extends K> classifier,
Collector<? super T,D> downstream)
Returns a
Collector implementing a concurrent 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 <T,K,D,M extends ConcurrentMap<K,D>> |
Collectors.groupingByConcurrent(Function<? super T,? extends K> classifier,
Supplier<M> mapFactory,
Collector<? super T,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 . |
static <T,U,R> Collector<T,R> |
Collectors.mapping(Function<? super T,? extends U> mapper,
Collector<? super U,R> downstream)
Adapts a
Collector<U,R> to a Collector<T,R> by applying
a mapping function to each input element before accumulation. |
static <T> Collector<T,T> |
Collectors.maxBy(Comparator<? super T> comparator)
Returns a
Collector<T, T> that produces the maximal element
according to a given Comparator . |
static <T> Collector<T,T> |
Collectors.minBy(Comparator<? super T> comparator)
Returns a
Collector<T, T> that produces the minimal element
according to a given Comparator . |
static <T> Collector<T,Map<Boolean,List<T>>> |
Collectors.partitioningBy(Predicate<? super T> predicate)
Returns a
Collector which partitions the input elements according
to a Predicate , and organizes them into a
Map<Boolean, List<T>> . |
static <T,D> Collector<T,Map<Boolean,D>> |
Collectors.partitioningBy(Predicate<? super T> predicate,
Collector<? super T,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<Boolean, D> whose values are the result of the downstream
reduction. |
static <T> Collector<T,T> |
Collectors.reducing(BinaryOperator<T> op)
Returns a
Collector<T,T> which performs a reduction of its
input elements under a specified BinaryOperator . |
static <T> Collector<T,T> |
Collectors.reducing(T identity,
BinaryOperator<T> op)
Returns a
Collector<T,T> which performs a reduction of its
input elements under a specified BinaryOperator . |
static <T,U> Collector<T,U> |
Collectors.reducing(U identity,
Function<? super T,? extends U> mapper,
BinaryOperator<U> op)
Returns a
Collector<T,U> which performs a reduction of its
input elements under a specified mapping function and
BinaryOperator . |
static <T> Collector<T,Long> |
Collectors.sumBy(Function<? super T,Long> mapper)
Returns a
Collector<T, Long> that produces the sum of a
long-valued function applied to the input element. |
static <T,C extends Collection<T>> |
Collectors.toCollection(Supplier<C> collectionFactory)
Returns a
Collector that accumulates the input elements into a
new Collection , in encounter order. |
static <T,K,U> Collector<T,ConcurrentMap<K,U>> |
Collectors.toConcurrentMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends U> valueMapper)
Accumulate elements into a
ConcurrentMap whose keys and values
are the result of applying mapping functions to the input elements. |
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)
Accumulate elements into a
ConcurrentMap whose keys and values
are the result of applying mapping functions to the input elements. |
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)
Accumulate elements into a
ConcurrentMap whose keys and values
are the result of applying mapping functions to the input elements. |
static <T> Collector<T,DoubleSummaryStatistics> |
Collectors.toDoubleSummaryStatistics(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 <T> Collector<T,IntSummaryStatistics> |
Collectors.toIntSummaryStatistics(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 <T> Collector<T,List<T>> |
Collectors.toList()
Returns a
Collector that accumulates the input elements into a
new List . |
static <T> Collector<T,LongSummaryStatistics> |
Collectors.toLongSummaryStatistics(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 <T,K,U> Collector<T,Map<K,U>> |
Collectors.toMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends U> valueMapper)
Accumulate elements into a
Map whose keys and values are the
result of applying mapping functions to the input elements. |
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)
Accumulate elements into a
Map whose keys and values are the
result of applying mapping functions to the input elements. |
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)
Accumulate elements into a
Map whose keys and values are the
result of applying mapping functions to the input elements. |
static <T> Collector<T,Set<T>> |
Collectors.toSet()
Returns a
Collector that accumulates the input elements into a
new Set . |
static Collector<String,StringBuilder> |
Collectors.toStringBuilder()
Returns a
Collector that concatenates the input elements into a
new StringBuilder . |
static Collector<CharSequence,StringJoiner> |
Collectors.toStringJoiner(CharSequence delimiter)
Returns a
Collector that concatenates the input elements into a
new StringJoiner , using the specified delimiter. |
Modifier and Type | Method and Description |
---|---|
<R> R |
DelegatingStream.collect(Collector<? super T,R> collector) |
<R> R |
Stream.collect(Collector<? super T,R> collector)
Performs a mutable
reduction operation on the elements of this stream using a
Collector object to describe the reduction. |
static <T,K,D> Collector<T,Map<K,D>> |
Collectors.groupingBy(Function<? super T,? extends K> classifier,
Collector<? super T,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 <T,K,D,M extends Map<K,D>> |
Collectors.groupingBy(Function<? super T,? extends K> classifier,
Supplier<M> mapFactory,
Collector<? super T,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 <T,K,D> Collector<T,ConcurrentMap<K,D>> |
Collectors.groupingByConcurrent(Function<? super T,? extends K> classifier,
Collector<? super T,D> downstream)
Returns a
Collector implementing a concurrent 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 <T,K,D,M extends ConcurrentMap<K,D>> |
Collectors.groupingByConcurrent(Function<? super T,? extends K> classifier,
Supplier<M> mapFactory,
Collector<? super T,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 . |
static <T,U,R> Collector<T,R> |
Collectors.mapping(Function<? super T,? extends U> mapper,
Collector<? super U,R> downstream)
Adapts a
Collector<U,R> to a Collector<T,R> by applying
a mapping function to each input element before accumulation. |
static <T,D> Collector<T,Map<Boolean,D>> |
Collectors.partitioningBy(Predicate<? super T> predicate,
Collector<? super T,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<Boolean, D> whose values are the result of the downstream
reduction. |
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, 2013, Oracle and/or its affiliates. All rights reserved.
DRAFT ea-b92