Class IterAbortable<T>

  • All Implemented Interfaces:
    java.util.Iterator<T>, org.apache.jena.atlas.iterator.IteratorCloseable<T>, org.apache.jena.atlas.lib.Closeable, Abortable

    public class IterAbortable<T>
    extends org.apache.jena.atlas.iterator.IteratorWrapper<T>
    implements Abortable, org.apache.jena.atlas.iterator.IteratorCloseable<T>
    Plain iterator version to add "abort" functionality. Iterator that adds an abort operation which can be called at any time, including from another thread, and causes the iterator to throw an exception when next touched (hasNext, next).
    • Constructor Summary

      Constructors 
      Constructor Description
      IterAbortable​(java.util.Iterator<T> iterator)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void abort()
      Can call asynchronously at any time
      boolean hasNext()  
      T next()  
      void remove()  
      • Methods inherited from class org.apache.jena.atlas.iterator.IteratorWrapper

        close
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.apache.jena.atlas.lib.Closeable

        close
      • Methods inherited from interface java.util.Iterator

        forEachRemaining
    • Constructor Detail

      • IterAbortable

        public IterAbortable​(java.util.Iterator<T> iterator)
    • Method Detail

      • abort

        public void abort()
        Can call asynchronously at any time
        Specified by:
        abort in interface Abortable
      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface java.util.Iterator<T>
        Overrides:
        hasNext in class org.apache.jena.atlas.iterator.IteratorWrapper<T>
      • next

        public T next()
        Specified by:
        next in interface java.util.Iterator<T>
        Overrides:
        next in class org.apache.jena.atlas.iterator.IteratorWrapper<T>
      • remove

        public void remove()
        Specified by:
        remove in interface java.util.Iterator<T>
        Overrides:
        remove in class org.apache.jena.atlas.iterator.IteratorWrapper<T>