Interface Merger

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 interface Merger
An interface which can merge double values.

Provides a few obvious stateless examples.

  • Method Summary

    Modifier and Type
    Method
    Description
    static Merger
    add()
    A merger which adds the elements.
    static Merger
    max()
    A merger which takes the maximum element.
    double
    merge(double first, double second)
    Merges first and second.
    static Merger
    min()
    A merger which takes the minimum element.
  • Method Details

    • merge

      double merge(double first, double second)
      Merges first and second.
      Parameters:
      first - The first input.
      second - The second input.
      Returns:
      The merged value.
    • max

      static Merger max()
      A merger which takes the maximum element.
      Returns:
      The maximum function.
    • min

      static Merger min()
      A merger which takes the minimum element.
      Returns:
      The minimum function.
    • add

      static Merger add()
      A merger which adds the elements.
      Returns:
      The addition function.