Class CloseableIterator<T>

  • Type Parameters:
    T - the type of elements returned by this iterator
    All Implemented Interfaces:
    java.util.Iterator<T>
    Direct Known Subclasses:
    TestsToRun.ClassesIterator

    public abstract class CloseableIterator<T>
    extends java.lang.Object
    implements java.util.Iterator<T>
    This iterator is marked as stopped if isClosed() returns true. If the iterator has been closed before calling hasNext() then the method returns false. If the iterator was closed after hasNext returns true but before next(), the method next() throws NoSuchElementException. The method remove() throws IllegalStateException if the iterator has been closed.
    Since:
    2.19.1
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract boolean doHasNext()  
      protected abstract T doNext()  
      protected abstract void doRemove()  
      boolean hasNext()  
      protected abstract boolean isClosed()  
      T next()  
      private boolean popMarker()  
      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

      • finishCurrentIteration

        private java.lang.Boolean finishCurrentIteration
    • Constructor Detail

      • CloseableIterator

        public CloseableIterator()
    • Method Detail

      • isClosed

        protected abstract boolean isClosed()
      • doHasNext

        protected abstract boolean doHasNext()
      • doNext

        protected abstract T doNext()
      • doRemove

        protected abstract void doRemove()
      • 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 void remove()
        Specified by:
        remove in interface java.util.Iterator<T>
      • popMarker

        private boolean popMarker()
        Returns:
        true if marker changed from NULL to anything