/** * seek forward on the iterator * * @param interval the interval to seek to * @return a RODRecordList at that location, null otherwise */ @Override public RODRecordList seekForward(GenomeLoc interval) { RODRecordList lt = iterator.seekForward(interval); createPastRecord(lt); return lt; }
/** * get the next record, either from the queue or from the iterator * * @return a RODRecordList */ private RODRecordList getNext() { if (aheadQueue.size() > 0) { RODRecordList ret = aheadQueue.getFirst().getList(); aheadQueue.removeFirst(); return ret; } else { RODRecordList ret = iterator.next(); createPastRecord(ret); return ret; } }
/** * get the position of this iterator * * @return */ @Override public GenomeLoc position() { return (aheadQueue.size() > 0) ? aheadQueue.getFirst().getLocation() : iterator.position(); }
/** * Gets the sequence dictionary associated with the backing input stream. * * @return sequence dictionary from the ROD header. */ @Override public SAMSequenceDictionary getSequenceDictionary() { return iterator.getSequenceDictionary(); }
/** * Gets the header associated with the backing input stream. * * @return the ROD header. */ @Override public Object getHeader() { return iterator.getHeader(); }
/** * can we flash back to the specified location? * * @param location the location to try and flash back to * @return true if we can, false otherwise */ public boolean canFlashBackTo(GenomeLoc location) { GenomeLoc farthestBack = (pastQueue.size() > 0) ? pastQueue.getFirst().getLocation() : iterator.peekNextLocation(); return (!farthestBack.isPast(location)); }
/** * do we have a next record * * @return true if we have another record */ @Override public boolean hasNext() { return (aheadQueue.size() > 0 || iterator.hasNext()); }