hammerlab/guacamole — pull request #248 by timodonnell (2014-11-23 18:26:07+00:00)
Title: Refactor LociInWindowsIterator

Replace LociInWindowsIterator

* Drops the LociInWindowsIterator class, adds the SlidingWindow.advanceMultiple function as a replacement, and modifies DistributedUtil to use this function.
* To enable this implementation, adds an iterator class to LociSet.SingleContig.
* Fixes a bug in LociMap I hit while working on this.

The primary motivation for this is readability, but there is also a subtle bug fix here. The hasNext() function on LociInWindowsIterator wasn't correct in general, since if skipEmpty=true, then it is impossible to know whether there are really more regions available to advance to without actually doing the advancing. (For example, suppose we have a window at locus 100, the next region to be read by that window is at locus 150, and we want to advance to position 1000. It is impossible to know if there are in fact regions at locus 1000 without first advancing through the region at locus 150.)

Closes #214.