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> V |
Maps.compute(Map<K,V> map,
K key,
BiFunction<? super K,? super V,? extends V> remappingFunction)
Attempts to compute a mapping for the specified key and its current
mapped value (or
null if there is no current mapping). |
static <K,V> V |
Maps.computeIfPresent(Map<K,V> map,
K key,
BiFunction<? super K,? super V,? extends V> remappingFunction)
If the value for the specified key is present and non-null, attempts to
compute a new mapping given the key and its current mapped value.
|
static <K,V> V |
Maps.merge(Map<K,V> map,
K key,
V value,
BiFunction<? super V,? super V,? extends V> remappingFunction)
If the specified key is not already associated with a value or is
associated with null, associates it with the given non-null value.
|
static <K,V> V |
Maps.mergeConcurrent(ConcurrentMap<K,V> map,
K key,
V value,
BiFunction<? super V,? super V,? extends V> remappingFunction)
If the specified key is not already associated with a value or is
associated with null, associates it with the given non-null value.
|
static <K,V> void |
Maps.replaceAll(Map<K,V> map,
BiFunction<? super K,? super V,? extends V> function)
Replaces each entry's value with the result of invoking the given
function on that entry until all entries have been processed or the
function throws an exception.
|
static <K,V> void |
Maps.replaceAllConcurrent(ConcurrentMap<K,V> map,
BiFunction<? super K,? super V,? extends V> function)
Replaces each entry's value with the result of invoking the given
function on that entry until all entries have been processed or the
function throws an exception.
|
Modifier and Type | Method and Description |
---|---|
<U> CompletionStage<U> |
CompletionStage.handle(BiFunction<? super T,Throwable,? extends U> fn)
Returns a new CompletionStage that, when this stage completes
either normally or exceptionally, is executed with this stage's
result and exception as arguments to the supplied function.
|
<U> CompletableFuture<U> |
CompletableFuture.handle(BiFunction<? super T,Throwable,? extends U> fn) |
<U> CompletionStage<U> |
CompletionStage.handleAsync(BiFunction<? super T,Throwable,? extends U> fn)
Returns a new CompletionStage that, when this stage completes
either normally or exceptionally, is executed using this stage's
default asynchronous execution facility, with this stage's
result and exception as arguments to the supplied function.
|
<U> CompletableFuture<U> |
CompletableFuture.handleAsync(BiFunction<? super T,Throwable,? extends U> fn) |
<U> CompletionStage<U> |
CompletionStage.handleAsync(BiFunction<? super T,Throwable,? extends U> fn,
Executor executor)
Returns a new CompletionStage that, when this stage completes
either normally or exceptionally, is executed using the
supplied executor, with this stage's result and exception as
arguments to the supplied function.
|
<U> CompletableFuture<U> |
CompletableFuture.handleAsync(BiFunction<? super T,Throwable,? extends U> fn,
Executor executor) |
<U,V> CompletionStage<V> |
CompletionStage.thenCombine(CompletionStage<? extends U> other,
BiFunction<? super T,? super U,? extends V> fn)
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 function.
|
<U,V> CompletableFuture<V> |
CompletableFuture.thenCombine(CompletionStage<? extends U> other,
BiFunction<? super T,? super U,? extends V> fn) |
<U,V> CompletionStage<V> |
CompletionStage.thenCombineAsync(CompletionStage<? extends U> other,
BiFunction<? super T,? super U,? extends V> fn)
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 function.
|
<U,V> CompletableFuture<V> |
CompletableFuture.thenCombineAsync(CompletionStage<? extends U> other,
BiFunction<? super T,? super U,? extends V> fn) |
<U,V> CompletionStage<V> |
CompletionStage.thenCombineAsync(CompletionStage<? extends U> other,
BiFunction<? super T,? super U,? extends V> fn,
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,V> CompletableFuture<V> |
CompletableFuture.thenCombineAsync(CompletionStage<? extends U> other,
BiFunction<? super T,? super U,? extends V> fn,
Executor executor) |
Modifier and Type | Interface and Description |
---|---|
interface |
BinaryOperator<T>
Represents an operation upon two operands of the same type, producing a result
of the same type as the operands.
|
Modifier and Type | Method and Description |
---|---|
static <R,T,U,V> BiFunction<T,U,V> |
BiFunctions.andThen(BiFunction<? super T,? super U,? extends R> this_,
Function<? super R,? extends V> after)
Returns a composed function that first applies the
this_ function to
its inputs, and then applies the after function to the result. |
Modifier and Type | Method and Description |
---|---|
static <R,T,U,V> BiFunction<T,U,V> |
BiFunctions.andThen(BiFunction<? super T,? super U,? extends R> this_,
Function<? super R,? extends V> after)
Returns a composed function that first applies the
this_ function to
its inputs, and then applies the after function to the result. |
Modifier and Type | Method and Description |
---|---|
<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.
|
Copyright © 2015. All rights reserved.