On this page

Computable

@FunctionalInterface public interface org.apache.commons.lang3.concurrent.Computable<I, O>[source]

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>.

Type parameters:
  • <I> – The type of the input to the calculation

  • <O> – The type of the output of the calculation

Since:

3.6

See also:

FailableFunction

Methods

O

compute(I arg)

This method carries out the given operation with the provided argument.

O compute(I arg) throws InterruptedException[source]

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.