java.lang.Object
io.deephaven.engine.rowset.impl.rsp.container.RankCursor

public final class RankCursor extends Object
Rank navigation within a single container that resumes from where the previous query left off.

Container.select(int), Container.find(short) and Container.getShortRangeIterator(int) on a BitmapContainer count words from the start of the bitmap on every call, and on a RunContainer count runs from the first run, so a loop asking about consecutive ranks or values in one container does work proportional to the square of the number of queries. This cursor remembers the word or run it last stopped at, together with the number of values before it. A query at or beyond that point continues from there; one behind it starts over. Ascending queries, the common case for bulk operations, cost the container's length once in total.

For the other container kinds these queries are already cheap, and the cursor delegates to the container.

The cursor's position describes the container as it was when reset(io.deephaven.engine.rowset.impl.rsp.container.Container) was called. A container mutated since must be reset(io.deephaven.engine.rowset.impl.rsp.container.Container) again before the cursor is used. Cursors are not thread safe.