Interface Computable<I,O>

Type Parameters:
I - the type of the input to the calculation
O - the type of the output of the calculation
All Known Implementing Classes:
Memoizer
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 Computable<I,O>
Definition of an interface for a wrapper around a calculation that takes a single parameter and returns a result.

This interface allows for wrapping a calculation into a class so that it maybe passed around an application.

See also FailableFunction<I, O, InterruptedException>.

Since:
3.6
See Also:
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    compute(I arg)
    This method carries out the given operation with the provided argument.
  • Method Details Link icon

    • compute Link icon

      This method carries out the given operation with the provided argument.
      Parameters:
      arg - the argument for the calculation
      Returns:
      the result of the calculation
      Throws:
      InterruptedException - thrown if the calculation is interrupted