net.ericaro.neoitertools.generators
Class TakeWhileGenerator<T>

java.lang.Object
  extended by net.ericaro.neoitertools.generators.TakeWhileGenerator<T>
All Implemented Interfaces:
Generator<T>

public class TakeWhileGenerator<T>
extends java.lang.Object
implements Generator<T>

a Generator that returns elements from the Generator as long as the predicate is true.

Author:
eric
See Also:
TakeWhileGenerator's wiki page, neoitertools site

Constructor Summary
TakeWhileGenerator(Lambda<? super T,java.lang.Boolean> predicate, Generator<T> iterator)
          Make an iterator that returns elements from the iterator as long as the predicate is true.
 
Method Summary
 T next()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TakeWhileGenerator

public TakeWhileGenerator(Lambda<? super T,java.lang.Boolean> predicate,
                          Generator<T> iterator)
Make an iterator that returns elements from the iterator as long as the predicate is true.

Parameters:
iterator -
predicate -
Method Detail

next

public T next()
Specified by:
next in interface Generator<T>
Returns:
the next item in the sequence.


Copyright © 2011. All Rights Reserved.