Package com.google.common.geometry
Class S2CellIndex.Delta
- java.lang.Object
-
- com.google.common.geometry.S2CellIndex.Delta
-
- Enclosing class:
- S2CellIndex
private static final class S2CellIndex.Delta extends java.lang.Object
To build the cell tree and leaf cell ranges, we maintain a stack of (cellId, label) pairs that contain the current leaf cell. This class represents an instruction to push or pop a (cellId, label) pair.If label >= 0, the (cellId, label) pair is pushed on the stack. If cellId == S2CellId.SENTINEL, a pair is popped from the stack. Otherwise the stack is unchanged but a RangeNode is still emitted.
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.Comparator<S2CellIndex.Delta>
BY_START_CELL_NEG_LABEL
Deltas are sorted first by startId, then in reverse order by cellId, and then by label.private S2CellId
cellId
private int
label
private S2CellId
startId
-
-
-
Field Detail
-
BY_START_CELL_NEG_LABEL
public static final java.util.Comparator<S2CellIndex.Delta> BY_START_CELL_NEG_LABEL
Deltas are sorted first by startId, then in reverse order by cellId, and then by label. This is necessary to ensure that (1) larger cells are pushed on the stack before smaller cells, and (2) cells are popped off the stack before any new cells are added.
-
startId
private final S2CellId startId
-
cellId
private final S2CellId cellId
-
label
private final int label
-
-