Package org.apache.tapestry5.func
Interface LazyFunction<T>
-
public interface LazyFunction<T>
A lazy function is used to populate aFlow
incrementally. Lazy functions allow calculations to be deferred. They also support infinitely large Flows, where successive values are computed just as needed.- Since:
- 5.2.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description LazyContinuation<T>
next()
Calculates the next value for the function.
-
-
-
Method Detail
-
next
LazyContinuation<T> next()
Calculates the next value for the function. The return value is tricky: it combines the next value in theFlow
with a function to compute the value after that as aLazyContinuation
. Alternately, a LazyFunction can return null to indicate that it has returned all the values it can.- Returns:
- continuation containing next value and next function, or null when no more values can be produced
-
-