edu.rice.cs.plt.concurrent
Interface IncrementalTask<I,R>

Type Parameters:
I - The type of the incremental result (may be Void if there is no useful intermediate result)
R - The type of the final result (may be Void if the task has no useful final result)
All Superinterfaces:
ResolvingThunk<R>, Thunk<R>

public interface IncrementalTask<I,R>
extends ResolvingThunk<R>

A thunk that performs incremental computation. Clients will repeatedly invoke step() until isResolved() is true, signifying that the result has been computed. value() need only be supported after the task has completed.


Method Summary
 boolean isResolved()
          Whether the final result is ready.
 I step()
          Perform a step in the computation.
 R value()
          Produce the final result of the task.
 

Method Detail

isResolved

boolean isResolved()
Whether the final result is ready. As long as this returns false, step() will be invoked; after returning true, only value() will be invoked.

Specified by:
isResolved in interface ResolvingThunk<R>

step

I step()
Perform a step in the computation. Undefined when isResolved() is true.


value

R value()
Produce the final result of the task. Undefined when isResolved() is false.

Specified by:
value in interface Thunk<R>