Payload - The payload type.public final class NullFreeIterator<Payload> extends Object implements Iterator<Payload>
NullFreeIterator is an Iterator that can be wrapped around
a given Iterator and filters out null values.
Calling next() will never return null and
calling hasNext() will never return true,
unless a value that is not null is available.
| Constructor and Description |
|---|
NullFreeIterator(Iterator<? extends Payload> iterator)
Creates a new
NullFreeIterator. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasNext() |
Payload |
next() |
void |
remove() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemainingpublic NullFreeIterator(Iterator<? extends Payload> iterator) throws IllegalArgumentException
NullFreeIterator.iterator - The Iterator to iterate over.IllegalArgumentException - If the given Iterator is null.public Payload next() throws NoSuchElementException
next in interface Iterator<Payload>NoSuchElementExceptionpublic void remove()
throws IllegalStateException,
UnsupportedOperationException
remove in interface Iterator<Payload>IllegalStateExceptionUnsupportedOperationExceptionCopyright © 2015–2017 Markenwerk – Gesellschaft für markenbildende Maßnahmen mbH. All rights reserved.