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
Constructors Constructor Description MapperIterator(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Function<? super SRCTYPE,? extends ELEMENTTYPE>getConverter()booleanhasNext()ELEMENTTYPEnext()voidremove()StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods 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, getCount
-
Methods inherited from interface com.helger.commons.collection.iterate.IIterableIterator
iterator, withFilter, withMapper
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
-
-
-
Constructor Detail
-
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.
-
-
Method Detail
-
getConverter
@Nonnull public Function<? super SRCTYPE,? extends ELEMENTTYPE> getConverter()
- Returns:
- The converter as specified in the constructor.
-
next
@Nullable public ELEMENTTYPE next()
-
-