Class IteratorImpl<E>

  • Type Parameters:
    E - type of element of the list
    All Implemented Interfaces:
    Iterator<E>
    Direct Known Subclasses:
    ListIteratorImpl

    public class IteratorImpl<E>
    extends Object
    implements Iterator<E>
    Custom iterator over a collection.
    Author:
    Andrea "Stock" Stocchero
    See Also:
    Iterator
    • Method Detail

      • hasNext

        public boolean hasNext()
        Returns true if the iteration has more elements.
        Specified by:
        hasNext in interface Iterator<E>
      • next

        public E next()
        Returns the next element in the iteration.
        Specified by:
        next in interface Iterator<E>
      • remove

        public void remove()
        Removes from the underlying collection the last element returned by this iterator. This method can be called only once per call to next().
        Specified by:
        remove in interface Iterator<E>