Class PredicateFilterDecoratingClosableIterator<T>

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

public class PredicateFilterDecoratingClosableIterator<T> extends Object implements htsjdk.samtools.util.CloseableIterator<T>
Performs on-the-fly filtering of the provided VariantContext Iterator such that only variants that satisfy all predicates are emitted. This class only exists because Iterators.filter(Iterator, Predicate) won't produce a CloseableIterator, which is necessary.
  • Constructor Details

    • PredicateFilterDecoratingClosableIterator

      public PredicateFilterDecoratingClosableIterator(htsjdk.samtools.util.CloseableIterator<T> underlyingIterator, Collection<com.google.common.base.Predicate<T>> predicates)
  • Method Details

    • hasNext

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

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

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface htsjdk.samtools.util.CloseableIterator<T>
    • remove

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