Class OverlapIterator<I extends java.lang.Comparable<? super I>,​V>


  • public class OverlapIterator<I extends java.lang.Comparable<? super I>,​V>
    extends java.lang.Object
    A class for iterating sequentially through an ordered collection and efficiently finding the overlapping set of matching intervals. The algorithm is quite simple: the intervals are sorted ascending by both min and max in two separate lists. These lists are walked forwards each time we visit a new point, with the set of intervals in the min-ordered list being added to our set of overlaps, and those in the max-ordered list being removed.
    • Constructor Summary

      Constructors 
      Constructor Description
      OverlapIterator​(java.util.Collection<Interval<I,​V>> intervals)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Set<V> overlaps()  
      void update​(I point)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • OverlapIterator

        public OverlapIterator​(java.util.Collection<Interval<I,​V>> intervals)
    • Method Detail

      • update

        public void update​(I point)
      • overlaps

        public java.util.Set<V> overlaps()