public class FilterIterator<E> extends AbstractIterator<E> implements CloseableIterator<E>
CloseableIterator
and will close the provided iterator if it also implemented CloseableIterator.
This iterator supports removal as long as the provided iterator supports removal. Although note only entries returned by the filter can be removed.
Constructor and Description |
---|
FilterIterator(Iterator<E> iter,
Predicate<? super E> filter) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected E |
getNext()
Method to implement to provide an iterator implementation.
|
void |
remove() |
forEachRemaining, hasNext, next
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining, hasNext, next
protected E getNext()
AbstractIterator
getNext
in class AbstractIterator<E>
public void close()
close
in interface AutoCloseable
close
in interface CloseableIterator<E>
Copyright © 2021 JBoss by Red Hat. All rights reserved.