From - The type to convert values from.To - The type to convert values to.public final class ConvertingIterator<From,To> extends Object implements Iterator<To>
ConvertingIterator is an Iterator that can be wrapped
around a given Iterator and converts all values with a given
Converter.| Constructor and Description |
|---|
ConvertingIterator(Iterator<? extends From> iterator,
Converter<? super From,? extends To> converter)
Creates a new
ConvertingIterator. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasNext() |
To |
next() |
void |
remove() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemainingpublic ConvertingIterator(Iterator<? extends From> iterator, Converter<? super From,? extends To> converter) throws IllegalArgumentException
ConvertingIterator.iterator - The Iterator to be used.converter - The Converter to be used.IllegalArgumentException - If the given Iterator is null or the given
Converter is null.public boolean hasNext()
throws NoSuchElementException
hasNext in interface Iterator<To>NoSuchElementExceptionpublic To next() throws NoSuchElementException
next in interface Iterator<To>NoSuchElementExceptionpublic void remove()
throws IllegalStateException,
UnsupportedOperationException
remove in interface Iterator<To>IllegalStateExceptionUnsupportedOperationExceptionCopyright © 2015–2017 Markenwerk – Gesellschaft für markenbildende Maßnahmen mbH. All rights reserved.