org.apache.lucene.util
Class FilterIterator<T>

java.lang.Object
  extended by org.apache.lucene.util.FilterIterator<T>
All Implemented Interfaces:
Iterator<T>

public abstract class FilterIterator<T>
extends Object
implements Iterator<T>

An Iterator implementation that filters elements with a boolean predicate.

See Also:
predicateFunction(T)

Constructor Summary
FilterIterator(Iterator<T> baseIterator)
           
 
Method Summary
 boolean hasNext()
           
 T next()
           
protected abstract  boolean predicateFunction(T object)
          returns true, if this element should be returned by next().
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FilterIterator

public FilterIterator(Iterator<T> baseIterator)
Method Detail

predicateFunction

protected abstract boolean predicateFunction(T object)
returns true, if this element should be returned by next().


hasNext

public final boolean hasNext()
Specified by:
hasNext in interface Iterator<T>

next

public final T next()
Specified by:
next in interface Iterator<T>

remove

public final void remove()
Specified by:
remove in interface Iterator<T>


Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.