net.sf.staccatocommons.defs
Interface Thunk<T>

Type Parameters:
T - the type of provided value
All Known Subinterfaces:
Accumulator<A,B>

@Applicative
public interface Thunk<T>

A Thunk is a computation that takes no arguments a returns a value. In other words, is an object that is capable of providing another one, through it value() method.

Thunks of return type Void have semantics compatible with Runnable, as they do not provide a value, but a side effect instead

Notice: the meaning of the term "Thunk" is sometimes vague and varies depending the context and author. Within Staccato-Commons, thunk must be interpreted a "no arguments expression"

Author:
flbulgarelli
See Also:
Recomendations for implementing

Method Summary
 T value()
          Returns the value provided.
 

Method Detail

value

T value()
Returns the value provided. Sending this message to the Thunk is also known as evaluating the thunk.

Returns:
the provided object. It is sometimes referred as the thunk's element


Get Staccatocommons at SourceForge.net. Fast, secure and Free Open Source software downloads