net.ericaro.neoitertools.generators
Class FilterGenerator<T>
java.lang.Object
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
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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)
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.