On this page

Computable

@FunctionalInterface public abstract 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>.

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

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

See also:

FailableFunction

Since:

3.6

Methods

compute(Object)

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

public abstract 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:

java.lang.InterruptedException – Thrown if the calculation is interrupted.