IRandomAccessCursor
Defined in: packages/data/src/cursor/irandom-access-cursor.ts:6
A cursor over a sequence that also supports O(1) indexed positioning.
Extends
Section titled “Extends”Type Parameters
Section titled “Type Parameters”T extends DefinedValue = DefinedValue
Properties
Section titled “Properties”
readonlyindex: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.
readonlyvalid:boolean
Defined in: packages/data/src/cursor/icursor.ts:16
False once moved past the end, or once its element was removed.
Inherited from
Section titled “Inherited from”
readonlyvalue:T|undefined
Defined in: packages/data/src/cursor/icursor.ts:19
The element at this position, undefined when not valid.
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”advance()
Section titled “advance()”advance():
boolean
Defined in: packages/data/src/cursor/icursor.ts:26
Moves one position forward.
Returns
Section titled “Returns”boolean
false if that moved past the end.
Inherited from
Section titled “Inherited from”clone()
Section titled “clone()”clone():
IRandomAccessCursor<T>
Defined in: packages/data/src/cursor/irandom-access-cursor.ts:20
An independent cursor at the same position.
Returns
Section titled “Returns”IRandomAccessCursor<T>
Overrides
Section titled “Overrides”retreat()
Section titled “retreat()”retreat():
boolean
Defined in: packages/data/src/cursor/ibidirectional-cursor.ts:14
Moves one position back.
Returns
Section titled “Returns”boolean
false if that moved before the start.
Inherited from
Section titled “Inherited from”seek()
Section titled “seek()”seek(
index):boolean
Defined in: packages/data/src/cursor/irandom-access-cursor.ts:18
Moves directly to the given index.
Parameters
Section titled “Parameters”number
The index to move to. Negative counts from the end.
Returns
Section titled “Returns”boolean
false if the index is out of bounds.