import { PointerList } from "https://deno.land/x/velo@1.0.0/src/utils/pointer_list.ts";
Implements a fixed size double-linked list of reference pointers. This implementation relies on a custom pointer system [1]. Utilizing TypedArrays for better engine optimization.
The list internally relies on an incrementing index. To not destroy the index
based structure use the newPointer()
method to create a index that can be
safely inserted.
const list = new PointerList(10);
const p = list.newPointer();
list.pushFront(p);
Properties
Methods
Inserts a pointer after a given reference pointer into the list if it is not full.
Moves a given pointer to the position after a reference pointer in the list
Method to create a save pointer to be inserted into the list. This new pointer is not stored in the list. Use insert to do that.
Returns the the next element of a given reference pointer. If the next element would be root undefined is returned.
Returns the the previous element of a given reference pointer. If the previous element would be the element before root undefined is returned.