BitmapCursor

A walk over a bitmap's ordinals, ascending.

val cursor = bitmap.cursor()
while (cursor.next()) { /* cursor.value */}

Owns nothing and closes nothing — but a cursor over a BitmapView reads through the view's mapping, so it lives under the same rule the view does: it must not outlive the arena that mapped the file.

advanceTo is what makes an index intersection cheaper than a merge. Walking two bitmaps from the start costs the sum of their cardinalities; walking the sparser one and jumping the denser costs the sparser, which is the difference between reading a sidecar and reading past it.

Properties

Link copied to clipboard
val value: Int

The ordinal the cursor sits on.

Functions

Link copied to clipboard
fun advanceTo(ordinal: Int): Boolean

Advances to the first ordinal at or above ordinal. false once the bitmap is exhausted.

Link copied to clipboard
fun next(): Boolean

Advances to the next ordinal. false once the bitmap is exhausted.