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
public class FilteringSamIterator extends Object implements CloseableIterator<SAMRecord>
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
Constructors Constructor Description FilteringSamIterator(Iterator<SAMRecord> iterator, SamRecordFilter filter)
ConstructorFilteringSamIterator(Iterator<SAMRecord> iterator, SamRecordFilter filter, boolean filterByPair)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Should be implemented to close/release any underlying resources.boolean
hasNext()
Returns true if the iteration has more elements.SAMRecord
next()
Returns the next element in the iteration.void
remove()
Required method for Iterator API.-
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 Detail
-
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
public FilteringSamIterator(Iterator<SAMRecord> iterator, SamRecordFilter filter)
Constructor- Parameters:
iterator
- the backing iteratorfilter
- the filter (which may be a FilterAggregator)
-
-
Method Detail
-
hasNext
public boolean hasNext()
Returns true if the iteration has more elements.
-
next
public SAMRecord 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>
-
-