|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.mit.jverbnet.util.FilteringIterator<E>
public abstract class FilteringIterator<E>
An iterator that filters the output of another iterator.
This implementation does not support the remove() method; if that
method is called it throws UnsupportedOperationException.
| Constructor Summary | |
|---|---|
FilteringIterator(java.util.Iterator<E> backingItr)
Creates a new filtering iterator that uses the specified iterator to supply its elements. |
|
| Method Summary | |
|---|---|
protected void |
advance()
Finds the next valid element from the backing iterator. |
boolean |
hasNext()
|
protected abstract boolean |
include(E element)
Returns true if the specified element should be returned by
the filtering iterator; false if the element should be
filtered. |
E |
next()
|
void |
remove()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FilteringIterator(java.util.Iterator<E> backingItr)
backingItr - the iterator from which the filtering iterator gets its
elements; may not be null
java.lang.NullPointerException - if the specified iterator is null| Method Detail |
|---|
protected void advance()
protected abstract boolean include(E element)
true if the specified element should be returned by
the filtering iterator; false if the element should be
filtered.
element - the item to be checkedpublic boolean hasNext()
hasNext in interface java.util.Iterator<E>public E next()
next in interface java.util.Iterator<E>public void remove()
remove in interface java.util.Iterator<E>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||