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.

@FunctionalInterface public static interface AnnotatedTypeScanner.Reduce<R>
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

    Modifier and Type
    Method
    Description
    reduce(R add, R acc)
    Returns the combination of two results.
  • Method Details

    • reduce

      R reduce(R add, R acc)
      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