Class AbstractConverterCollection.ConverterIterator

  • All Implemented Interfaces:
    java.util.Enumeration<D>, java.util.Iterator<D>
    Enclosing class:
    AbstractConverterCollection<S,​D>

    protected class AbstractConverterCollection.ConverterIterator
    extends IteratorDecorator<D>
    A custom proxied iterator that converts returned elements on the fly.
    Author:
    Garret Wilson
    • Constructor Summary

      Constructors 
      Constructor Description
      ConverterIterator​(java.util.Iterator<S> iterator)
      Iterator constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      D next()
      Converts and returns the next element in the iteration.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Enumeration

        asIterator
      • Methods inherited from interface java.util.Iterator

        forEachRemaining
    • Constructor Detail

      • ConverterIterator

        public ConverterIterator​(java.util.Iterator<S> iterator)
        Iterator constructor.
        Parameters:
        iterator - The iterator of source objects.
    • Method Detail

      • next

        public D next()
        Converts and returns the next element in the iteration.
        Specified by:
        next in interface java.util.Iterator<D>
        Overrides:
        next in class AbstractIteratorDecorator<D>
        Returns:
        An object representing the converted next element in the iteration.
        Throws:
        java.util.NoSuchElementException - Thrown if the iteration has no more elements.