Added changes to bounded read iterator, it now explicitly takes a MSRI2 instead of the interfaces ClosableIterator<SAMRecord>. It would be good to fix this in the future with an interface that lets you get the (possibly merged) header.

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@552 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
aaron 2009-04-28 17:57:54 +00:00
parent 395aaf48b0
commit b6874f30cb
1 changed files with 7 additions and 2 deletions

View File

@ -1,5 +1,6 @@
package org.broadinstitute.sting.gatk.iterators;
import net.sf.samtools.SAMFileHeader;
import net.sf.samtools.SAMRecord;
import net.sf.samtools.util.CloseableIterator;
@ -39,7 +40,7 @@ public class BoundedReadIterator implements CloseableIterator<SAMRecord>, Iterab
private long currentCount = 0;
// the iterator we want to decorate
private final CloseableIterator<SAMRecord> iterator;
private final MergingSamRecordIterator2 iterator;
// our unmapped read flag
private boolean doNotUseThatUnmappedReadPile = false;
@ -55,7 +56,7 @@ public class BoundedReadIterator implements CloseableIterator<SAMRecord>, Iterab
* @param iter
* @param readCount
*/
public BoundedReadIterator(CloseableIterator<SAMRecord> iter, long readCount) {
public BoundedReadIterator(MergingSamRecordIterator2 iter, long readCount) {
if (iter != null) {
isOpen = true;
@ -69,6 +70,10 @@ public class BoundedReadIterator implements CloseableIterator<SAMRecord>, Iterab
}
public SAMFileHeader getMergedHeader() {
return iterator.getMergedHeader();
}
/**
* Do we have a next? If the iterator has a read and we're not over the read
* count, then yes