Class ReverseListIterator<E>

  • Type Parameters:
    E -
    All Implemented Interfaces:
    java.lang.Iterable<E>, java.util.Iterator<E>

    public class ReverseListIterator<E>
    extends java.lang.Object
    implements java.util.Iterator<E>, java.lang.Iterable<E>
    An iterator over List which goes from the end to the start
    • Constructor Summary

      Constructors 
      Constructor Description
      ReverseListIterator​(java.util.List<E> list)
      Construct.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean hasNext()  
      java.util.Iterator<E> iterator()  
      E next()  
      void remove()  
      • Methods inherited from class java.lang.Object

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

        forEach, spliterator
      • Methods inherited from interface java.util.Iterator

        forEachRemaining
    • Constructor Detail

      • ReverseListIterator

        public ReverseListIterator​(java.util.List<E> list)
        Construct.
        Parameters:
        list - the list which will be iterated in reverse order
    • Method Detail

      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface java.util.Iterator<E>
      • next

        public E next()
        Specified by:
        next in interface java.util.Iterator<E>
      • remove

        public void remove()
        Specified by:
        remove in interface java.util.Iterator<E>
      • iterator

        public java.util.Iterator<E> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<E>