Package org.cometd.common
Interface AsyncFoldLeft.Operation<T,R>
-
- Type Parameters:
T
- the type of elementR
- the type of the result
- Enclosing class:
- AsyncFoldLeft
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public static interface AsyncFoldLeft.Operation<T,R>
The operation to invoke for each element.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
apply(R result, T element, AsyncFoldLeft.Loop<R> loop)
Processes the givenelement
.
-
-
-
Method Detail
-
apply
void apply(R result, T element, AsyncFoldLeft.Loop<R> loop)
Processes the given
element
.The processing of the element must produce a result that is the reduction of the accumulated
result
with the result of the processing of the givenelement
.After the processing of the given element, the implementation must decide whether to continue with or break out of the iteration (with the reduced result) or to fail the iteration (with an exception).
- Parameters:
result
- the accumulated result so farelement
- the element to processloop
- the control object that continues or breaks the iteration
-
-