- Type Parameters:
C
- the type of criteriaT
- the element type
- All Known Implementing Classes:
Beans
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A functional interface whose implementations can reduce an unspecified notional
collection of elements to a single element according to some criteria.
This interface is related to, but should not be confused with, the Reducer
interface, which can be used to
build Reducible
instances.
- Author:
- Laird Nelson
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic <C,
E> Reducible <C, E> of
(Selectable<C, E> selectable, Reducer<C, E> r) static <C,
E> Reducible <C, E> of
(Selectable<C, E> selectable, Reducer<C, E> r, BiFunction<? super List<? extends E>, ? super C, ? extends E> failureHandler) static <C,
E> Reducible <C, E> ofCaching
(Selectable<C, E> selectable, Reducer<C, E> r) static <C,
E> Reducible <C, E> ofCaching
(Selectable<C, E> selectable, Reducer<C, E> r, BiFunction<? super List<? extends E>, ? super C, ? extends E> failureHandler) static <C,
E> Reducible <C, E> ofCaching
(Selectable<C, E> selectable, Reducer<C, E> r, BiFunction<? super List<? extends E>, ? super C, ? extends E> failureHandler, BiFunction<? super C, Function<C, E>, ? extends E> computeIfAbsent) Given a criteria object, which may benull
, returns an object that represents the reduction of a notional collection of objects.
-
Method Details
-
reduce
Given a criteria object, which may benull
, returns an object that represents the reduction of a notional collection of objects.Most
Reducible
implementations will return determine values from invocations of this method, but there is no requirement to do so.- Parameters:
criteria
- the criteria; may benull
to indicate no criteria- Returns:
- a single object, or
null
- Throws:
ReductionException
- if reduction could not occur or if an error occurs
-
of
-
of
static <C,E> Reducible<C,E> of(Selectable<C, E> selectable, Reducer<C, E> r, BiFunction<? super List<? extends E>, ? super C, ? extends E> failureHandler) -
ofCaching
-
ofCaching
static <C,E> Reducible<C,E> ofCaching(Selectable<C, E> selectable, Reducer<C, E> r, BiFunction<? super List<? extends E>, ? super C, ? extends E> failureHandler) -
ofCaching
static <C,E> Reducible<C,E> ofCaching(Selectable<C, E> selectable, Reducer<C, E> r, BiFunction<? super List<? extends E>, ? super C, ? extends E> failureHandler, BiFunction<? super C, Function<C, E>, ? extends E> computeIfAbsent)
-