Class AbstractIterator<T>

  • All Implemented Interfaces:
    java.util.Iterator<T>

    abstract class AbstractIterator<T>
    extends java.lang.Object
    implements java.util.Iterator<T>
    A partial implementation of Iterator. The only method remaining to implement by a subclass is findNext().

    Not intended for public use.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private T next  
      protected T NO_MORE_ELEMENTS
      A marker object that can be returned by findNext() to mark the end of the iterator.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected AbstractIterator()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract T findNext()  
      boolean hasNext()  
      T 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.util.Iterator

        forEachRemaining
    • Field Detail

      • NO_MORE_ELEMENTS

        protected final T NO_MORE_ELEMENTS
        A marker object that can be returned by findNext() to mark the end of the iterator.
      • next

        private T next
    • Constructor Detail

      • AbstractIterator

        protected AbstractIterator()
    • Method Detail

      • hasNext

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

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

        public final void remove()
        Specified by:
        remove in interface java.util.Iterator<T>
      • findNext

        protected abstract T findNext()
        Returns:
        the next element to return by the iterator, or NO_MORE_ELEMENTS if there are no more elements