Package org.dmfs.jems2.iterator
Class Mapped<OriginalType,ResultType>
- java.lang.Object
-
- org.dmfs.jems2.iterator.BaseIterator<ResultType>
-
- org.dmfs.jems2.iterator.Mapped<OriginalType,ResultType>
-
- Type Parameters:
OriginalType- The original type of the values iterated by the decoratedIterator.ResultType- The type of the values iterated by thisIterator.
- All Implemented Interfaces:
java.util.Iterator<ResultType>
public final class Mapped<OriginalType,ResultType> extends BaseIterator<ResultType>
-
-
Constructor Summary
Constructors Constructor Description Mapped(Function<? super OriginalType,? extends ResultType> mapFunction, java.util.Iterator<OriginalType> original)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasNext()ResultTypenext()-
Methods inherited from class org.dmfs.jems2.iterator.BaseIterator
equals, hashCode, remove
-
-
-
-
Constructor Detail
-
Mapped
public Mapped(Function<? super OriginalType,? extends ResultType> mapFunction, java.util.Iterator<OriginalType> original)
Creates aMappedIteratorthat iterates the elements of the givenIteratorafter mapping them using the givenFunction.- Parameters:
mapFunction- TheFunctionto apply to all elements.original- TheIteratorto be mapped.
-
-
Method Detail
-
hasNext
public final boolean hasNext()
-
next
public final ResultType next()
-
-