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
ConstructorDescriptionFilteringSamIterator
(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, wait
Methods inherited from interface htsjdk.samtools.util.CloseableIterator
stream, toList
Methods 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:
next
in interfaceIterator<SAMRecord>
- Returns:
- the next element in the iteration
- Throws:
NoSuchElementException
-
remove
public void remove()Required method for Iterator API.- Specified by:
remove
in interfaceIterator<SAMRecord>
- Throws:
UnsupportedOperationException
-
close
public void close()Description copied from interface:CloseableIterator
Should be implemented to close/release any underlying resources.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceCloseableIterator<SAMRecord>
-