Class MapperIterator<SRCTYPE,ELEMENTTYPE>
java.lang.Object
com.helger.commons.collection.iterate.MapperIterator<SRCTYPE,ELEMENTTYPE>
- Type Parameters:
SRCTYPE- The type of the source iteratorELEMENTTYPE- The type of this iterator
- All Implemented Interfaces:
ICommonsIterable<ELEMENTTYPE>,IIterableIterator<ELEMENTTYPE>,Iterable<ELEMENTTYPE>,Iterator<ELEMENTTYPE>
public class MapperIterator<SRCTYPE,ELEMENTTYPE>
extends Object
implements IIterableIterator<ELEMENTTYPE>
A simple iterator that changes the object type from a source type to a
destination type.
- Author:
- Philip Helger
-
Constructor Summary
ConstructorsConstructorDescriptionMapperIterator(IIterableIterator<? extends SRCTYPE> aBaseIter, Function<? super SRCTYPE, ? extends ELEMENTTYPE> aConverter) Constructor.MapperIterator(Iterable<? extends SRCTYPE> aBaseCont, Function<? super SRCTYPE, ? extends ELEMENTTYPE> aConverter) Constructor.MapperIterator(Iterator<? extends SRCTYPE> aBaseIter, Function<? super SRCTYPE, ? extends ELEMENTTYPE> aConverter) Constructor. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.helger.commons.collection.impl.ICommonsIterable
containsAny, containsNone, containsOnly, findAll, findAllInstanceOf, findAllMapped, findAllMapped, findAllMapped, findFirst, findFirst, findFirstIndex, findFirstMapped, findFirstMapped, findLastIndex, forEachBreakable, forEachByIndex, forEachThrowing, getCount, getCountMethods inherited from interface com.helger.commons.collection.iterate.IIterableIterator
iterator, withFilter, withMapperMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
MapperIterator
public MapperIterator(@Nonnull IIterableIterator<? extends SRCTYPE> aBaseIter, @Nonnull Function<? super SRCTYPE, ? extends ELEMENTTYPE> aConverter) Constructor.- Parameters:
aBaseIter- The base iterable iterator to use. May not benull.aConverter- The converter to be used. May not benull.
-
MapperIterator
public MapperIterator(@Nonnull Iterable<? extends SRCTYPE> aBaseCont, @Nonnull Function<? super SRCTYPE, ? extends ELEMENTTYPE> aConverter) Constructor.- Parameters:
aBaseCont- The collection to iterate. May not benull.aConverter- The converter to be used. May not benull.
-
MapperIterator
public MapperIterator(@Nonnull Iterator<? extends SRCTYPE> aBaseIter, @Nonnull Function<? super SRCTYPE, ? extends ELEMENTTYPE> aConverter) Constructor.- Parameters:
aBaseIter- The base iterator to use. May not benull.aConverter- The converter to be used. May not benull.
-
-
Method Details
-
getConverter
- Returns:
- The converter as specified in the constructor.
-
hasNext
public boolean hasNext() -
next
-
remove
public void remove() -
toString
-