DoublyLinkedListCursor
Defined in: packages/data/src/list/doubly-linked-list.ts:38
A cursor over a DoublyLinkedList.
A cursor whose element was removed — by any means, not just through this
cursor — is exactly when valid becomes false; the underlying node is
marked on removal, and every cursor still referencing it observes that mark.
end()’s cursor has no node of its own: insertAfter/insertBefore on it
append (reading the list’s current tail live, so it never goes stale), and
retreat() from it moves to the current last element. Retreating past the
first element fails (returns false, cursor unchanged) rather than modelling
a symmetrical “before the beginning” position.
Type Parameters
Section titled “Type Parameters”T extends DefinedValue
The type of elements in the list.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new DoublyLinkedListCursor<
T>(list,node):DoublyLinkedListCursor<T>
Defined in: packages/data/src/list/doubly-linked-list.ts:41
Parameters
Section titled “Parameters”DoublyLinkedListNode_<T> | null
Returns
Section titled “Returns”DoublyLinkedListCursor<T>
Accessors
Section titled “Accessors”Get Signature
Section titled “Get Signature”get valid():
boolean
Defined in: packages/data/src/list/doubly-linked-list.ts:46
False once moved past the end, or once its element was removed.
Returns
Section titled “Returns”boolean
False once moved past the end, or once its element was removed.
Implementation of
Section titled “Implementation of”Get Signature
Section titled “Get Signature”get value():
T|undefined
Defined in: packages/data/src/list/doubly-linked-list.ts:50
The element at this position, undefined when not valid.
Returns
Section titled “Returns”T | undefined
The element at this position, undefined when not valid.
Implementation of
Section titled “Implementation of”Methods
Section titled “Methods”advance()
Section titled “advance()”advance():
boolean
Defined in: packages/data/src/list/doubly-linked-list.ts:54
Moves one position forward.
Returns
Section titled “Returns”boolean
false if that moved past the end.
Implementation of
Section titled “Implementation of”clone()
Section titled “clone()”clone():
DoublyLinkedListCursor<T>
Defined in: packages/data/src/list/doubly-linked-list.ts:87
An independent cursor at the same position.
Returns
Section titled “Returns”DoublyLinkedListCursor<T>
Implementation of
Section titled “Implementation of”retreat()
Section titled “retreat()”retreat():
boolean
Defined in: packages/data/src/list/doubly-linked-list.ts:63
Moves one position back.
Returns
Section titled “Returns”boolean
false if that moved before the start.