edu.rice.cs.plt.recur
Class ArgContinuation<T,R>
java.lang.Object
edu.rice.cs.plt.recur.PendingContinuation<R>
edu.rice.cs.plt.recur.ArgContinuation<T,R>
- All Implemented Interfaces:
- ResolvingThunk<R>, Thunk<R>, Continuation<R>
public abstract class ArgContinuation<T,R>
- extends PendingContinuation<R>
A continuation for results that depend on a single recursive invocation, followed by some
additional computation. Instances must implement arg(), which wraps the recursive
invocation, and apply(T), which performs the remaining computation.
|
Method Summary |
protected abstract Continuation<? extends R> |
apply(T arg)
Given the result of evaluating arg(), produce a continuation for the ultimate result. |
protected abstract Continuation<? extends T> |
arg()
Produce a continuation computing the result of a recursive invocation. |
Continuation<R> |
step()
Create a ComposedContinuation in terms of the result of arg() and a lambda wrapper
of apply(). |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ArgContinuation
public ArgContinuation()
arg
protected abstract Continuation<? extends T> arg()
- Produce a continuation computing the result of a recursive invocation.
apply
protected abstract Continuation<? extends R> apply(T arg)
- Given the result of evaluating
arg(), produce a continuation for the ultimate result.
step
public Continuation<R> step()
- Create a
ComposedContinuation in terms of the result of arg() and a lambda wrapper
of apply().
- Specified by:
step in interface Continuation<R>- Specified by:
step in class PendingContinuation<R>