lombok-pg -

lombok
Class Yield

java.lang.Object
  extended by lombok.Yield

public class Yield
extends Object


Constructor Summary
Yield()
           
 
Method Summary
static
<T> void
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

Yield

public Yield()
Method Detail

yield

public static <T> void yield(T value)
A take on yield return.
 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 -

Copyright © 2010-2011 Philipp Eichhorn, licensed under the MIT licence.