| Package | Description |
|---|---|
| java.util.stream |
Classes to support functional-style operations on streams of elements, such as map-reduce transformations on collections.
|
| Modifier and Type | Method and Description |
|---|---|
static <T> Collector |
Collectors.averagingDouble(ToDoubleFunction
Returns a
Collector that produces the arithmetic mean of a double-valued function applied to the input elements.
|
static <T> Collector |
Collectors.averagingInt(ToIntFunction
Returns a
Collector that produces the arithmetic mean of an integer-valued function applied to the input elements.
|
static <T> Collector |
Collectors.averagingLong(ToLongFunction
Returns a
Collector that produces the arithmetic mean of a long-valued function applied to the input elements.
|
static <T |
Collectors.collectingAndThen(Collector
Adapts a
Collector to perform an additional finishing transformation.
|
static <T> Collector |
Collectors.counting()
Returns a
Collector accepting elements of type
T that counts the number of input elements.
|
static <T |
Collectors.groupingBy(Function
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 <T |
Collectors.groupingBy(Function
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 |
Collectors.groupingBy(Function
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 |
Collectors.groupingByConcurrent(Function
Returns a concurrent
Collector implementing a "group by" operation on input elements of type
T, grouping elements according to a classification function.
|
static <T |
Collectors.groupingByConcurrent(Function
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 |
Collectors.groupingByConcurrent(Function
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 |
Collectors.joining()
Returns a
Collector that concatenates the input elements into a
String, in encounter order.
|
static Collector |
Collectors.joining(CharSequence
Returns a
Collector that concatenates the input elements, separated by the specified delimiter, in encounter order.
|
static Collector |
Collectors.joining(CharSequence
Returns a
Collector that concatenates the input elements, separated by the specified delimiter, with the specified prefix and suffix, in encounter order.
|
static <T |
Collectors.mapping(Function
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 <T> Collector |
Collectors.maxBy(Comparator
Returns a
Collector that produces the maximal element according to a given
Comparator, described as an
Optional<T>.
|
static <T> Collector |
Collectors.minBy(Comparator
Returns a
Collector that produces the minimal element according to a given
Comparator, described as an
Optional<T>.
|
static <T |
Collector.of(Supplier
Returns a new
Collector described by the given
supplier,
accumulator,
combiner, and
finisher functions.
|
static <T |
Collector.of(Supplier
Returns a new
Collector described by the given
supplier,
accumulator, and
combiner functions.
|
static <T> Collector |
Collectors.partitioningBy(Predicate
Returns a
Collector which partitions the input elements according to a
Predicate, and organizes them into a
Map<Boolean, List<T>>.
|
static <T |
Collectors.partitioningBy(Predicate
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 |
Collectors.reducing(BinaryOperator
Returns a
Collector which performs a reduction of its input elements under a specified
BinaryOperator.
|
static <T> Collector |
Collectors.reducing(T identity, BinaryOperator
Returns a
Collector which performs a reduction of its input elements under a specified
BinaryOperator using the provided identity.
|
static <T |
Collectors.reducing(U identity, Function
Returns a
Collector which performs a reduction of its input elements under a specified mapping function and
BinaryOperator.
|
static <T> Collector |
Collectors.summarizingDouble(ToDoubleFunction
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 |
Collectors.summarizingInt(ToIntFunction
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 |
Collectors.summarizingLong(ToLongFunction
Returns a
Collector which applies an
long-producing mapping function to each input element, and returns summary statistics for the resulting values.
|
static <T> Collector |
Collectors.summingDouble(ToDoubleFunction
Returns a
Collector that produces the sum of a double-valued function applied to the input elements.
|
static <T> Collector |
Collectors.summingInt(ToIntFunction
Returns a
Collector that produces the sum of a integer-valued function applied to the input elements.
|
static <T> Collector |
Collectors.summingLong(ToLongFunction
Returns a
Collector that produces the sum of a long-valued function applied to the input elements.
|
static <T |
Collectors.toCollection(Supplier
Returns a
Collector that accumulates the input elements into a new
Collection, in encounter order.
|
static <T |
Collectors.toConcurrentMap(Function
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 <T |
Collectors.toConcurrentMap(Function
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 <T |
Collectors.toConcurrentMap(Function
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 <T> Collector |
Collectors.toList()
Returns a
Collector that accumulates the input elements into a new
List.
|
static <T |
Collectors.toMap(Function
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 <T |
Collectors.toMap(Function
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 <T |
Collectors.toMap(Function
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 <T> Collector |
Collectors.toSet()
Returns a
Collector that accumulates the input elements into a new
Set.
|
| Modifier and Type | Method and Description |
|---|---|
<R |
Stream.collect(Collector
Performs a
mutable reduction operation on the elements of this stream using a
Collector.
|
static <T |
Collectors.collectingAndThen(Collector
Adapts a
Collector to perform an additional finishing transformation.
|
static <T |
Collectors.groupingBy(Function
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 |
Collectors.groupingBy(Function
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 |
Collectors.groupingByConcurrent(Function
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 |
Collectors.groupingByConcurrent(Function
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 |
Collectors.mapping(Function
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 <T |
Collectors.partitioningBy(Predicate
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.
|