public class FunctionIterator<T,V> extends java.lang.Object implements CloseableIterator<V>
Iterator
implementation to convert each item from the target
iterator
to a new object applying the function
on next()
.Constructor and Description |
---|
FunctionIterator(java.lang.Iterable<T> iterable,
java.util.function.Function<? super T,? extends V> function) |
FunctionIterator(java.util.Iterator<T> newIterator,
java.util.function.Function<? super T,? extends V> function) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
boolean |
hasNext() |
V |
next() |
void |
remove() |
public FunctionIterator(java.lang.Iterable<T> iterable, java.util.function.Function<? super T,? extends V> function)
public void remove()
remove
in interface java.util.Iterator<V>
public boolean hasNext()
hasNext
in interface java.util.Iterator<V>
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException