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 <T extends RuntimeException> |
Objects.checkFromIndexSize(int fromIndex,
int size,
int length,
BiFunction<Integer,Integer,T> oobe)
Checks if the sub-range from
fromIndex (inclusive) to
fromIndex + size (exclusive) is within the bounds of range from
0 (inclusive) to length (exclusive). |
static <T extends RuntimeException> |
Objects.checkFromToIndex(int fromIndex,
int toIndex,
int length,
BiFunction<Integer,Integer,T> oobe)
Checks if the sub-range from
fromIndex (inclusive) to
toIndex (exclusive) is within the bounds of range from 0
(inclusive) to length (exclusive). |
static <T extends RuntimeException> |
Objects.checkIndex(int index,
int length,
BiFunction<Integer,Integer,T> oobe)
Checks if the
index is within the bounds of the range from
0 (inclusive) to length (exclusive). |
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)
Deprecated.
|
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)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
static <K,V> V |
ConcurrentMaps.compute(ConcurrentMap<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 |
ConcurrentMaps.computeIfPresent(ConcurrentMap<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 |
ConcurrentMaps.merge(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 |
ConcurrentMaps.replaceAll(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 | 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.