Class FilteredIterator<T>

  extended by javatools.datatypes.PeekIterator<T>
      extended by javatools.datatypes.FilteredIterator<T>
All Implemented Interfaces:, java.lang.Iterable<T>, java.util.Iterator<T>
Direct Known Subclasses:

public class FilteredIterator<T>
extends PeekIterator<T>

This class is part of the Java Tools (see It is licensed under the Creative Commons Attribution License (see by the YAGO-NAGA team (see The class wraps an iterator and returns only those elements that fulfill a condition

Nested Class Summary
static interface FilteredIterator.If<T>
static class FilteredIterator.IgnoreErrors<T>
          Wraps an iterator and skips elements that produce an exception
Nested classes/interfaces inherited from class javatools.datatypes.PeekIterator
PeekIterator.ElementaryPeekIterator<T>, PeekIterator.SimplePeekIterator<T>
Field Summary
Fields inherited from class javatools.datatypes.PeekIterator
closed, initialized, next
Constructor Summary
FilteredIterator(java.util.Iterator<T> i, FilteredIterator.If<T> condition)
Method Summary
 T internalNext()
          Returns the next or NULL if no next element is available
 void remove()
          Removes the current element, if supported by the underlying iterator
Methods inherited from class javatools.datatypes.PeekIterator
asList, asList, asSet, asSet, asSet, close, emptyIterator, hasNext, iterator, list, list, main, next, nextOrNull, numElements, numElements, peek, toString, toString, toString
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail


public FilteredIterator(java.util.Iterator<T> i,
                        FilteredIterator.If<T> condition)
Method Detail


public T internalNext()
Description copied from class: PeekIterator
Returns the next or NULL if no next element is available


public void remove()
Description copied from class: PeekIterator
Removes the current element, if supported by the underlying iterator

Specified by:
remove in interface java.util.Iterator<T>
remove in class PeekIterator<T>