Package htsjdk.samtools
Class SamReader.AssertingIterator
java.lang.Object
htsjdk.samtools.SamReader.AssertingIterator
- All Implemented Interfaces:
SAMRecordIterator
,CloseableIterator<SAMRecord>
,Closeable
,AutoCloseable
,Iterator<SAMRecord>
- Enclosing interface:
- SamReader
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionassertSorted
(SAMFileHeader.SortOrder sortOrder) Establishes that records returned by this iterator are expected to be in the specified sort order.void
close()
Should be implemented to close/release any underlying resources.boolean
hasNext()
next()
void
remove()
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
-
AssertingIterator
-
-
Method Details
-
assertSorted
Description copied from interface:SAMRecordIterator
Establishes that records returned by this iterator are expected to be in the specified sort order. If this method has been called, then implementers must throw an IllegalStateException from next() when a record is read that violates the sort order. This method may be called multiple times over the course of an iteration, changing the expected sort, if desired -- from the time it is called, it validates whatever sort is set, or stops validating if it is set to null or SAMFileHeader.SortOrder.unsorted. If this method is not called, then no validation of the iterated records is done.- Specified by:
assertSorted
in interfaceSAMRecordIterator
- Parameters:
sortOrder
- The order in which records are expected to be returned- Returns:
- This SAMRecordIterator
-
next
-
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>
-
hasNext
public boolean hasNext() -
remove
public void remove()
-