Package com.google.common.geometry
Class S2ShapeIndex.RangeIterator
- java.lang.Object
-
- com.google.common.geometry.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.
-
-
Field Summary
Fields Modifier and Type Field Description private S2ShapeIndex.S2ClippedShape
clipped
private static S2CellId
END
private S2CellId
id
private S2Iterator<S2ShapeIndex.Cell>
it
private S2CellId
rangeMax
private S2CellId
rangeMin
-
Constructor Summary
Constructors Constructor Description RangeIterator(S2ShapeIndex index)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description S2ShapeIndex.Cell
cell()
S2ShapeIndex.S2ClippedShape
clipped()
Various other convenience methods for the current cell.boolean
containsCenter()
boolean
done()
S2CellId
id()
Returns the current S2CellId or cell contents.void
next()
int
numEdges()
S2CellId
rangeMax()
S2CellId
rangeMin()
Returns the min and max leaf cell ids covered by the current cell.private void
refresh()
Updates internal state after the iterator has been repositioned.void
seekBeyond(S2ShapeIndex.RangeIterator target)
Positions the iterator at the first cell that followstarget
, i.e.void
seekTo(S2ShapeIndex.RangeIterator target)
Positions the iterator at the first cell that overlaps or followstarget
, i.e.
-
-
-
Field Detail
-
END
private static final S2CellId END
-
it
private S2Iterator<S2ShapeIndex.Cell> it
-
id
private S2CellId id
-
rangeMin
private S2CellId rangeMin
-
rangeMax
private S2CellId rangeMax
-
clipped
private S2ShapeIndex.S2ClippedShape clipped
-
-
Constructor Detail
-
RangeIterator
public RangeIterator(S2ShapeIndex index)
-
-
Method Detail
-
id
public S2CellId id()
Returns the current S2CellId or cell contents.
-
cell
public S2ShapeIndex.Cell cell()
-
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.
-
rangeMax
public S2CellId rangeMax()
-
clipped
public S2ShapeIndex.S2ClippedShape clipped()
Various other convenience methods for the current cell.
-
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 followstarget
, i.e. such that rangeMax() >= target.rangeMin().
-
seekBeyond
public void seekBeyond(S2ShapeIndex.RangeIterator target)
Positions the iterator at the first cell that followstarget
, i.e. the first cell such that rangeMin() > target.rangeMax().
-
refresh
private void refresh()
Updates internal state after the iterator has been repositioned.
-
-