Package | Description |
---|---|
java8.util |
Provides some of the new
java.util classes and implementations of
static and default interface methods added in Java 8 and, in addition, the
JEP 269: Convenience Factory
Methods for Collections that were introduced in Java 9. |
java8.util.function |
Functional interfaces provide target types for lambda expressions
and method references.
|
java8.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> void |
J8Arrays.parallelPrefix(T[] array,
BinaryOperator<T> op)
Cumulates, in parallel, each element of the given array in place,
using the supplied function.
|
static <T> void |
J8Arrays.parallelPrefix(T[] array,
int fromIndex,
int toIndex,
BinaryOperator<T> op)
Performs
J8Arrays.parallelPrefix(Object[], BinaryOperator)
for the given subrange of the array. |
Modifier and Type | Method and Description |
---|---|
static <T> BinaryOperator<T> |
BinaryOperators.maxBy(Comparator<? super T> comparator)
Returns a
BinaryOperator which returns the greater of two elements
according to the specified Comparator . |
static <T> BinaryOperator<T> |
BinaryOperators.minBy(Comparator<? super T> comparator)
Returns a
BinaryOperator which returns the lesser of two elements
according to the specified Comparator . |
Modifier and Type | Method and Description |
---|---|
BinaryOperator<A> |
Collector.combiner()
A function that accepts two partial results and merges them.
|
Modifier and Type | Method and Description |
---|---|
static <T,A,R> Collector<T,A,R> |
Collectors.of(Supplier<A> supplier,
BiConsumer<A,T> accumulator,
BinaryOperator<A> combiner,
Function<A,R> finisher,
Collector.Characteristics... characteristics)
Returns a new
Collector described by the given supplier ,
accumulator , combiner , and finisher functions. |
static <T,R> Collector<T,R,R> |
Collectors.of(Supplier<R> supplier,
BiConsumer<R,T> accumulator,
BinaryOperator<R> combiner,
Collector.Characteristics... characteristics)
Returns a new
Collector described by the given supplier ,
accumulator , and combiner functions. |
Optional<T> |
Stream.reduce(BinaryOperator<T> accumulator)
Performs a reduction on the
elements of this stream, using an
associative accumulation
function, and returns an
Optional describing the reduced value,
if any. |
T |
Stream.reduce(T identity,
BinaryOperator<T> accumulator)
Performs a reduction on the
elements of this stream, using the provided identity value and an
associative
accumulation function, and returns the reduced value.
|
<U> U |
Stream.reduce(U identity,
BiFunction<U,? super T,U> accumulator,
BinaryOperator<U> combiner)
Performs a reduction on the
elements of this stream, using the provided identity, accumulation and
combining functions.
|
static <T> Collector<T,?,Optional<T>> |
Collectors.reducing(BinaryOperator<T> op)
Returns a
Collector 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 which performs a reduction of its
input elements under a specified BinaryOperator using the
provided identity. |
static <T,U> Collector<T,?,U> |
Collectors.reducing(U identity,
Function<? super T,? extends U> mapper,
BinaryOperator<U> op)
Returns a
Collector which performs a reduction of its
input elements under a specified mapping function and
BinaryOperator . |
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)
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,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> mapFactory)
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,K,U> Collector<T,?,Map<K,U>> |
Collectors.toMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends U> valueMapper,
BinaryOperator<U> 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 <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> mapFactory)
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,K,U> Collector<T,?,Map<K,U>> |
Collectors.toUnmodifiableMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends U> valueMapper,
BinaryOperator<U> 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. |
Copyright © 2018. All rights reserved.