E - is the generic type of the iterated elements.public class FilteredIterator<E> extends AbstractIterator<E>
Iterator that adapts another Iterator but only iterates the elements that are accepted by a given Filter. Iterator interface, it is NOT possible to implement the AbstractIterator.remove()
method properly here. The method AbstractIterator.hasNext() has to step forward in the adapted Iterator and a call of
AbstractIterator.remove() would cause unintended and unpredictable results after AbstractIterator.hasNext() has been called. To
prevent damage AbstractIterator.remove() will always throw an UnsupportedOperationException.| Modifier and Type | Field and Description |
|---|---|
private Iterator<? extends E> |
delegate
The actual iterator instance to adapt.
|
private Filter<? super E> |
filter |
| Constructor and Description |
|---|
FilteredIterator(Iterator<? extends E> delegate,
Filter<? super E> filter)
The constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected E |
findNext()
This method tries to find the
next element. |
findFirst, hasNext, next, removeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemainingprotected E findNext()
AbstractIteratornext element.findNext in class AbstractIterator<E>null if done.Copyright © 2001–2019 mmm-Team. All rights reserved.