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.AutoCloseable closeable,
java.lang.Iterable<T> iterable,
java.util.function.Function<? super T,? extends V> function)
Construct an instance with the provided root object, iterable and function.
|
FunctionIterator(java.lang.AutoCloseable closeable,
java.util.Iterator<T> newIterator,
java.util.function.Function<? super T,? extends V> function)
Construct an instance with the provided root object, iterator and function.
|
FunctionIterator(java.lang.Iterable<T> iterable,
java.util.function.Function<? super T,? extends V> function)
Construct an instance with the provided iterable and function.
|
FunctionIterator(java.util.Iterator<T> newIterator,
java.util.function.Function<? super T,? extends V> function)
Construct an instance with the provided iterator and function.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
boolean |
hasNext() |
V |
next() |
public FunctionIterator(java.lang.Iterable<T> iterable, java.util.function.Function<? super T,? extends V> function)
iterable - the iterable.function - the function.public FunctionIterator(@Nullable
java.lang.AutoCloseable closeable,
java.lang.Iterable<T> iterable,
java.util.function.Function<? super T,? extends V> function)
closeable - an AutoCloseable to close when iteration is complete.iterable - the iterable.function - the function.public FunctionIterator(java.util.Iterator<T> newIterator, java.util.function.Function<? super T,? extends V> function)
newIterator - the iterator.function - the function.public FunctionIterator(@Nullable
java.lang.AutoCloseable closeable,
java.util.Iterator<T> newIterator,
java.util.function.Function<? super T,? extends V> function)
closeable - an AutoCloseable to close when iteration is complete.newIterator - the iterator.function - the function.public boolean hasNext()
hasNext in interface java.util.Iterator<V>public void close()
close in interface java.lang.AutoCloseableclose in interface CloseableIterator<V>