|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.rice.cs.plt.lambda.DelayedThunk<R>
public class DelayedThunk<R>
A thunk whose value is set once after creation, but before the first
invocation of value().
As a wrapper for arbitrary objects, instances of this class will serialize without error only if the wrapped object is serializable.
| Constructor Summary | |
|---|---|
DelayedThunk()
|
|
| Method Summary | ||
|---|---|---|
boolean |
isResolved()
Test whether the thunk is in a "resolved" state. |
|
static
|
make()
Call the constructor (allows R to be inferred) |
|
void |
set(R val)
Set the value. |
|
R |
value()
Access the value. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DelayedThunk()
| Method Detail |
|---|
public R value()
value in interface Thunk<R>java.lang.IllegalStateException - if the value has not been setpublic void set(R val)
set in interface Box<R>java.lang.IllegalStateException - if the value has already been setpublic boolean isResolved()
ResolvingThunktrue, an invocation of value
will return promptly and without exception.
isResolved in interface ResolvingThunk<R>public static <R> DelayedThunk<R> make()
R to be inferred)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||