Package com.google.common.geometry
Class S2CellIndex.RangeIterator
- java.lang.Object
-
- com.google.common.geometry.S2CellIndex.RangeIterator
-
- Direct Known Subclasses:
S2CellIndex.NonEmptyRangeIterator
- Enclosing class:
- S2CellIndex
public class S2CellIndex.RangeIterator extends Object
An iterator that seeks and iterates over a set of non-overlapping leaf cell ranges that cover the entire sphere. The indexed (s2cell_id, label) pairs that intersect the current leaf cell range can be visited using ContentsIterator (see below).
-
-
Constructor Summary
Constructors Constructor Description RangeIterator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadvance(int n)Advances this iterator 'n' times and returns true, or if doing so would advance this iterator past the end, leaves the iterator unmodified and returns false.voidbegin()Positions this iterator at the first range of leaf cells (if any).booleandone()Returns true if the iterator is positioned beyond the last valid range.voidfinish()Positions the iterator so that done() is true.booleanisEmpty()Returns true if no (s2cell_id, label) pairs intersect this range, or ifdone().S2CellIdlimitId()The (non-inclusive) end of the current range of leaf S2CellIds.voidnext()Advances the iterator to the next range of leaf cells.booleanprev()Returns false if the iterator was already positioned at the beginning, otherwise positions the iterator at the previous entry and returns true.voidseek(S2CellId target)Positions the iterator at the range containing "target".S2CellIdstartId()Returns the start of the current range of leaf S2CellIds.
-
-
-
Method Detail
-
startId
public S2CellId startId()
-
limitId
public S2CellId limitId()
The (non-inclusive) end of the current range of leaf S2CellIds.
-
done
public boolean done()
Returns true if the iterator is positioned beyond the last valid range.
-
begin
public void begin()
Positions this iterator at the first range of leaf cells (if any).
-
finish
public void finish()
Positions the iterator so that done() is true.
-
next
public void next()
Advances the iterator to the next range of leaf cells.
-
prev
public boolean prev()
Returns false if the iterator was already positioned at the beginning, otherwise positions the iterator at the previous entry and returns true.
-
seek
public void seek(S2CellId target)
Positions the iterator at the range containing "target". Such a range exists as long as the target is a valid leaf cell.- Parameters:
target- a valid leaf (level 30) cell to seek to
-
isEmpty
public boolean isEmpty()
Returns true if no (s2cell_id, label) pairs intersect this range, or ifdone().
-
advance
public boolean advance(int n)
Advances this iterator 'n' times and returns true, or if doing so would advance this iterator past the end, leaves the iterator unmodified and returns false.
-
-