Package org.infinispan.commons.util
Class IteratorMapper<E,S>
- java.lang.Object
-
- org.infinispan.commons.util.IteratorMapper<E,S>
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,java.util.Iterator<S>
,CloseableIterator<S>
- Direct Known Subclasses:
CloseableIteratorMapper
public class IteratorMapper<E,S> extends java.lang.Object implements CloseableIterator<S>
A iterator that maps each value to the output of the Function. Note that the remove is supported if the iterator originally supported remove. This iterator implementsCloseableIterator
and will close the provided iterator if it also implemented CloseableIterator.- Since:
- 8.0
- Author:
- William Burns
-
-
Constructor Summary
Constructors Constructor Description IteratorMapper(java.util.Iterator<? extends E> iterator, java.util.function.Function<? super E,? extends S> function)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
boolean
hasNext()
S
next()
void
remove()
-
-
-
Method Detail
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfacejava.util.Iterator<E>
-
remove
public void remove()
- Specified by:
remove
in interfacejava.util.Iterator<E>
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfaceCloseableIterator<E>
-
-