Class ConverterIterator<T1,T2>

java.lang.Object
com.saperion.common.lang.iterator.ConverterIterator<T1,T2>
Type Parameters:
T1 - type of input objects
T2 - type of converted objects
All Implemented Interfaces:
Iterator<T2>

public final class ConverterIterator<T1,T2> extends Object implements 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 Details

    • ConverterIterator

      public ConverterIterator(Iterator<? extends T1> iterator, Converter<? super T1,? extends T2> converter)
      Creates a new ConverterIterator, that converts the objects of the specified iterator using the specified Converter.

      The specified iterator must not be null.

      The specified converter must not be null.

      Parameters:
      iterator - underlying iterator whose iteration should be converted
      converter - Converter
  • Method Details