Class AbstractConverterList.ConverterListIterator

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

    protected class AbstractConverterList.ConverterListIterator
    extends ListIteratorDecorator<D>
    A custom proxied list iterator that converts returned elements on the fly.
    Author:
    Garret Wilson
    • Constructor Detail

      • ConverterListIterator

        public ConverterListIterator​(java.util.ListIterator<S> listIterator)
        List iterator constructor.
        Parameters:
        listIterator - 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>
        Specified by:
        next in interface java.util.ListIterator<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.
      • previous

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