Skip to content

IRandomAccessCursor

Defined in: packages/data/src/cursor/irandom-access-cursor.ts:6

A cursor over a sequence that also supports O(1) indexed positioning.

T extends DefinedValue = DefinedValue

readonly index: number

Defined in: packages/data/src/cursor/irandom-access-cursor.ts:10

The index of this position. Equal to the sequence’s count() past the end.


readonly valid: boolean

Defined in: packages/data/src/cursor/icursor.ts:16

False once moved past the end, or once its element was removed.

IBidirectionalCursor.valid


readonly value: T | undefined

Defined in: packages/data/src/cursor/icursor.ts:19

The element at this position, undefined when not valid.

IBidirectionalCursor.value

advance(): boolean

Defined in: packages/data/src/cursor/icursor.ts:26

Moves one position forward.

boolean

false if that moved past the end.

IBidirectionalCursor.advance


clone(): IRandomAccessCursor<T>

Defined in: packages/data/src/cursor/irandom-access-cursor.ts:20

An independent cursor at the same position.

IRandomAccessCursor<T>

IBidirectionalCursor.clone


retreat(): boolean

Defined in: packages/data/src/cursor/ibidirectional-cursor.ts:14

Moves one position back.

boolean

false if that moved before the start.

IBidirectionalCursor.retreat


seek(index): boolean

Defined in: packages/data/src/cursor/irandom-access-cursor.ts:18

Moves directly to the given index.

number

The index to move to. Negative counts from the end.

boolean

false if the index is out of bounds.