Package picard.util

Class AsyncIterator<T>

java.lang.Object
picard.util.AsyncIterator<T>
All Implemented Interfaces:
htsjdk.samtools.util.CloseableIterator<T>, Closeable, AutoCloseable, Iterator<T>

public class AsyncIterator<T> extends Object implements htsjdk.samtools.util.CloseableIterator<T>
Wrapper around a CloseableIterator that reads in a separate thread, for cases in which that might be efficient.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    AsyncIterator(htsjdk.samtools.util.CloseableIterator<T> underlyingIterator, int queueSize, String threadNamePrefix)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Stops the thread and then calls synchronouslyClose() to allow implementation to do any one time clean up.
    boolean
     
     
    void
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface htsjdk.samtools.util.CloseableIterator

    stream, toList

    Methods inherited from interface java.util.Iterator

    forEachRemaining
  • Field Details

  • Constructor Details

    • AsyncIterator

      public AsyncIterator(htsjdk.samtools.util.CloseableIterator<T> underlyingIterator, int queueSize, String threadNamePrefix)
  • Method Details

    • hasNext

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

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

      public void remove()
      Specified by:
      remove in interface Iterator<T>
    • close

      public void close()
      Stops the thread and then calls synchronouslyClose() to allow implementation to do any one time clean up.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface htsjdk.samtools.util.CloseableIterator<T>