Package htsjdk.samtools.filter
Class FilteringSamIterator
java.lang.Object
htsjdk.samtools.filter.FilteringSamIterator
- All Implemented Interfaces:
CloseableIterator<SAMRecord>,Closeable,AutoCloseable,Iterator<SAMRecord>
- Direct Known Subclasses:
FilteringIterator
Filtering Iterator which takes a filter and an iterator and iterates through only those records
which are not rejected by the filter.
$Id$
-
Constructor Summary
ConstructorsConstructorDescriptionFilteringSamIterator(Iterator<SAMRecord> iterator, SamRecordFilter filter) ConstructorFilteringSamIterator(Iterator<SAMRecord> iterator, SamRecordFilter filter, boolean filterByPair) Constructor -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface htsjdk.samtools.util.CloseableIterator
stream, toListMethods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
FilteringSamIterator
public FilteringSamIterator(Iterator<SAMRecord> iterator, SamRecordFilter filter, boolean filterByPair) Constructor- Parameters:
iterator- the backing iteratorfilter- the filter (which may be a FilterAggregator)filterByPair- if true, filter reads in pairs
-
FilteringSamIterator
Constructor- Parameters:
iterator- the backing iteratorfilter- the filter (which may be a FilterAggregator)
-
-
Method Details
-
hasNext
public boolean hasNext()Returns true if the iteration has more elements. -
next
Returns the next element in the iteration.- Specified by:
nextin interfaceIterator<SAMRecord>- Returns:
- the next element in the iteration
- Throws:
NoSuchElementException
-
remove
public void remove()Required method for Iterator API.- Specified by:
removein interfaceIterator<SAMRecord>- Throws:
UnsupportedOperationException
-
close
public void close()Description copied from interface:CloseableIteratorShould be implemented to close/release any underlying resources.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceCloseableIterator<SAMRecord>
-