/** * Returns the next element in the iteration. * * @return the next element in the iteration * @throws java.util.NoSuchElementException * */ @Override public SAMRecord next() { if (next == null) { throw new NoSuchElementException("Iterator has no more elements."); } final SAMRecord result = next; next = getNextRecord(); return result; }
/** * Returns the next element in the iteration. * * @return the next element in the iteration * @throws java.util.NoSuchElementException * */ @Override public SAMRecord next() { if (next == null) { throw new NoSuchElementException("Iterator has no more elements."); } final SAMRecord result = next; next = getNextRecord(); return result; }
/** * Constructor * * @param iterator the backing iterator * @param filter the filter (which may be a FilterAggregator) */ public FilteringSamIterator(final Iterator<SAMRecord> iterator, final SamRecordFilter filter) { this.iterator = new PeekableIterator<SAMRecord>(iterator); this.filter = filter; next = getNextRecord(); }
/** * Constructor * * @param iterator the backing iterator * @param filter the filter (which may be a FilterAggregator) */ public FilteringSamIterator(final Iterator<SAMRecord> iterator, final SamRecordFilter filter) { this.iterator = new PeekableIterator<SAMRecord>(iterator); this.filter = filter; next = getNextRecord(); }
/** * Constructor * * @param iterator the backing iterator * @param filter the filter (which may be a FilterAggregator) * @param filterByPair if true, filter reads in pairs */ public FilteringSamIterator(final Iterator<SAMRecord> iterator, final SamRecordFilter filter, final boolean filterByPair) { if (filterByPair && iterator instanceof SAMRecordIterator) { ((SAMRecordIterator)iterator).assertSorted(SAMFileHeader.SortOrder.queryname); } this.iterator = new PeekableIterator<SAMRecord>(iterator); this.filter = filter; this.filterReadPairs = filterByPair; next = getNextRecord(); }
/** * Constructor * * @param iterator the backing iterator * @param filter the filter (which may be a FilterAggregator) * @param filterByPair if true, filter reads in pairs */ public FilteringSamIterator(final Iterator<SAMRecord> iterator, final SamRecordFilter filter, final boolean filterByPair) { if (filterByPair && iterator instanceof SAMRecordIterator) { ((SAMRecordIterator)iterator).assertSorted(SAMFileHeader.SortOrder.queryname); } this.iterator = new PeekableIterator<SAMRecord>(iterator); this.filter = filter; this.filterReadPairs = filterByPair; next = getNextRecord(); }