Package | Description |
---|---|
java8.util |
Provides some of the new
java.util classes and implementations
of static and default interface methods added in Java 8. |
java8.util.concurrent |
The Java 7 and Java 8 utility classes commonly used in concurrent programming.
|
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 <K,V> void |
Maps.forEach(java.util.Map<K,V> map,
BiConsumer<? super K,? super V> action)
Performs the given action for each entry in the map until all entries
have been processed or the action throws an exception.
|
static <K,V> void |
Maps.forEachConcurrent(java.util.concurrent.ConcurrentMap<K,V> map,
BiConsumer<? super K,? super V> action)
Performs the given action for each entry in the map until all entries
have been processed or the action throws an exception.
|
Modifier and Type | Method and Description |
---|---|
<U> CompletionStage<java.lang.Void> |
CompletionStage.thenAcceptBoth(CompletionStage<? extends U> other,
BiConsumer<? super T,? super U> action)
Returns a new CompletionStage that, when this and the other
given stage both complete normally, is executed with the two
results as arguments to the supplied action.
|
<U> CompletableFuture<java.lang.Void> |
CompletableFuture.thenAcceptBoth(CompletionStage<? extends U> other,
BiConsumer<? super T,? super U> action) |
<U> CompletionStage<java.lang.Void> |
CompletionStage.thenAcceptBothAsync(CompletionStage<? extends U> other,
BiConsumer<? super T,? super U> action)
Returns a new CompletionStage that, when this and the other
given stage complete normally, is executed using this stage's
default asynchronous execution facility, with the two results
as arguments to the supplied action.
|
<U> CompletableFuture<java.lang.Void> |
CompletableFuture.thenAcceptBothAsync(CompletionStage<? extends U> other,
BiConsumer<? super T,? super U> action) |
<U> CompletionStage<java.lang.Void> |
CompletionStage.thenAcceptBothAsync(CompletionStage<? extends U> other,
BiConsumer<? super T,? super U> action,
java.util.concurrent.Executor executor)
Returns a new CompletionStage that, when this and the other
given stage complete normally, is executed using the supplied
executor, with the two results as arguments to the supplied
function.
|
<U> CompletableFuture<java.lang.Void> |
CompletableFuture.thenAcceptBothAsync(CompletionStage<? extends U> other,
BiConsumer<? super T,? super U> action,
java.util.concurrent.Executor executor) |
CompletionStage<T> |
CompletionStage.whenComplete(BiConsumer<? super T,? super java.lang.Throwable> action)
Returns a new CompletionStage with the same result or exception
as this stage, and when this stage completes, executes the
given action with the result (or
null if none) and the
exception (or null if none) of this stage. |
CompletableFuture<T> |
CompletableFuture.whenComplete(BiConsumer<? super T,? super java.lang.Throwable> action) |
CompletionStage<T> |
CompletionStage.whenCompleteAsync(BiConsumer<? super T,? super java.lang.Throwable> action)
Returns a new CompletionStage with the same result or exception
as this stage, and when this stage completes, executes the
given action executes the given action using this stage's
default asynchronous execution facility, with the result (or
null if none) and the exception (or null if
none) of this stage as arguments. |
CompletableFuture<T> |
CompletableFuture.whenCompleteAsync(BiConsumer<? super T,? super java.lang.Throwable> action) |
CompletionStage<T> |
CompletionStage.whenCompleteAsync(BiConsumer<? super T,? super java.lang.Throwable> action,
java.util.concurrent.Executor executor)
Returns a new CompletionStage with the same result or exception
as this stage, and when this stage completes, executes using
the supplied Executor, the given action with the result (or
null if none) and the exception (or null if
none) of this stage as arguments. |
CompletableFuture<T> |
CompletableFuture.whenCompleteAsync(BiConsumer<? super T,? super java.lang.Throwable> action,
java.util.concurrent.Executor executor) |
Modifier and Type | Method and Description |
---|---|
static <T,U> BiConsumer<T,U> |
BiConsumers.andThen(BiConsumer<? super T,? super U> this_,
BiConsumer<? super T,? super U> after)
Returns a composed
BiConsumer that performs, in sequence, this_
operation followed by the after operation. |
Modifier and Type | Method and Description |
---|---|
static <T,U> BiConsumer<T,U> |
BiConsumers.andThen(BiConsumer<? super T,? super U> this_,
BiConsumer<? super T,? super U> after)
Returns a composed
BiConsumer that performs, in sequence, this_
operation followed by the after operation. |
static <T,U> BiConsumer<T,U> |
BiConsumers.andThen(BiConsumer<? super T,? super U> this_,
BiConsumer<? super T,? super U> after)
Returns a composed
BiConsumer that performs, in sequence, this_
operation followed by the after operation. |
Modifier and Type | Method and Description |
---|---|
BiConsumer<A,T> |
Collector.accumulator()
A function that folds a value into a mutable result container.
|
Modifier and Type | Method and Description |
---|---|
<R> R |
Stream.collect(Supplier<R> supplier,
BiConsumer<R,? super T> accumulator,
BiConsumer<R,R> combiner)
Performs a mutable
reduction operation on the elements of this stream.
|
<R> R |
Stream.collect(Supplier<R> supplier,
BiConsumer<R,? super T> accumulator,
BiConsumer<R,R> combiner)
Performs a mutable
reduction operation on the elements of this stream.
|
<R> R |
DoubleStream.collect(Supplier<R> supplier,
ObjDoubleConsumer<R> accumulator,
BiConsumer<R,R> combiner)
Performs a mutable
reduction operation on the elements of this stream.
|
<R> R |
IntStream.collect(Supplier<R> supplier,
ObjIntConsumer<R> accumulator,
BiConsumer<R,R> combiner)
Performs a mutable
reduction operation on the elements of this stream.
|
<R> R |
LongStream.collect(Supplier<R> supplier,
ObjLongConsumer<R> accumulator,
BiConsumer<R,R> combiner)
Performs a mutable
reduction operation on the elements of this stream.
|
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. |