Class ConverterIterator<T1,T2>
java.lang.Object
com.saperion.common.lang.iterator.ConverterIterator<T1,T2>
- Type Parameters:
T1
- type of input objectsT2
- type of converted objects
- All Implemented Interfaces:
Iterator<T2>
An Iterator
that converts the objects of an existing iterator using a Converter
.
Iterator.remove()
is not supported.
- Author:
- agz
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a newConverterIterator
, that converts the objects of the specified iterator using the specifiedConverter
. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
ConverterIterator
public ConverterIterator(Iterator<? extends T1> iterator, Converter<? super T1, ? extends T2> converter) Creates a newConverterIterator
, that converts the objects of the specified iterator using the specifiedConverter
. The specified iterator must not benull
. The specified converter must not benull
.- Parameters:
iterator
- underlying iterator whose iteration should be convertedconverter
-Converter
-
-
Method Details