|
lombok-pg - | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectlombok.Yield
public class Yield
| Constructor Summary | |
|---|---|
Yield()
|
|
| Method Summary | ||
|---|---|---|
static
|
yield(T value)
A take on yield return. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Yield()
| Method Detail |
|---|
public static <T> void yield(T value)
public static <S, T> Iterable<T> map(final Iterable<S> list, final Function1<S, T> mapping) {
for (S element : list)
yield(mapping.apply(element));
}
or:
public Iterator<Integer> genFib() {
long a = 0;
long b = 0;
while (b >= 0) {
yield(a);
long c = a + b;
a = b;
b = c;
}
}
|
lombok-pg - | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||