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

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

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

Returns items from the generator iif the condition is true. Note that the condition passed can be negated.

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

Constructor Summary
FilterGenerator(Lambda<T,java.lang.Boolean> predicate, Generator<T> source)
           
FilterGenerator(Lambda<T,java.lang.Boolean> predicate, Generator<T> source, boolean negate)
           
 
Method Summary
 T next()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FilterGenerator

public FilterGenerator(Lambda<T,java.lang.Boolean> predicate,
                       Generator<T> source)

FilterGenerator

public FilterGenerator(Lambda<T,java.lang.Boolean> predicate,
                       Generator<T> source,
                       boolean negate)
Method Detail

next

public T next()
       throws java.util.NoSuchElementException
Specified by:
next in interface Generator<T>
Returns:
the next item in the sequence.
Throws:
java.util.NoSuchElementException - when sequence is exhausted.


Copyright © 2011. All Rights Reserved.