Interface AnnotatedTypeScanner.Reduce<R>
- Type Parameters:
R- the result type
- Enclosing class:
AnnotatedTypeScanner<R,P>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Reduces two results into a single result.
Convention: add is the newly-produced contribution being folded in - either the
current type's own contribution from defaultAction, or a freshly-scanned sibling.
acc is the accumulator - either the result from recursively visiting the current
type's children (its subtree), or a running sum across already-processed siblings. Callers in
AnnotatedTypeScanner and its subclasses always pass arguments in this order, so
implementors of non-commutative reduce functions can rely on it.
-
Method Summary
-
Method Details
-
reduce
Returns the combination of two results.- Parameters:
add- the new contribution being folded in (current node or next sibling)acc- the accumulated subtree or sibling result so far- Returns:
- the combination of the two results
-