Class S2ShapeIndex.RangeIterator

  • Enclosing class:
    S2ShapeIndex

    public static final class S2ShapeIndex.RangeIterator
    extends java.lang.Object
    RangeIterator is a wrapper over CellIterator that is specialized for merging shape indices. This class is is well-tested by S2Loop.
    • Constructor Detail

      • RangeIterator

        public RangeIterator​(S2ShapeIndex index)
    • Method Detail

      • id

        public S2CellId id()
        Returns the current S2CellId or cell contents.
      • rangeMin

        public S2CellId rangeMin()
        Returns the min and max leaf cell ids covered by the current cell. If done() is true, these methods return a value larger than any valid cell id.
      • numEdges

        public int numEdges()
      • containsCenter

        public boolean containsCenter()
      • next

        public void next()
      • done

        public boolean done()
      • seekTo

        public void seekTo​(S2ShapeIndex.RangeIterator target)
        Positions the iterator at the first cell that overlaps or follows target, i.e. such that rangeMax() >= target.rangeMin().
      • seekBeyond

        public void seekBeyond​(S2ShapeIndex.RangeIterator target)
        Positions the iterator at the first cell that follows target, i.e. the first cell such that rangeMin() > target.rangeMax().
      • refresh

        private void refresh()
        Updates internal state after the iterator has been repositioned.