Class 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.

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Delta​(S2CellId startId, S2CellId cellId, int label)  
    • Method Summary

      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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
      • label

        private final int label
    • Constructor Detail