1.2.0
Creates a new bitmap sized according to the block size
(number)
BitMap
Set a bit
(BitMap)
(number)
BitMap
Unsets a bit
(BitMap)
(number)
BitMap
Checks if the entire bitmap is set
(BitMap)
boolean
Checks if the entire bitmap is unset
(BitMap)
(number)
boolean
Find first set algorithm If null is returned, all items have been set
(BitMap)
(number | null)
Checks if a bit is set.
(BitMap)
(number)
boolean
Class representing a lazy recursive fully-persistent bitmap tree. Only the leaf bitmaps correspond to counters. Interior bitmaps index their child bitmaps. If an interior bit is set, that means there's no free bits in the child bitmap. If an interior bit is not set, that means there's at least 1 free bit in the child bitmap. The snapshot parameter for allocate and deallocate controls how the persistence works. If a snapshot is passed in to mutation methods and a mutation occurs either by changing the current node or leaf, or creating a new parent or child, then these will always create new nodes or leafs instead of mutating the current node or leaf. If the node or leaf to be copied is already in a snapshot, then it will not bother copying unnecessarily.
Class representing a Leaf of the recursive bitmap tree. This represents the base case of the lazy recursive bitmap tree.
Extends BitMapTree
Class representing a Node of the recursive bitmap tree.
Extends BitMapTree
(number)
(boolean)
(number)
(number)
(BitMap)
(Array<Tree>)
Allocates a counter by allocating the corresponding child. Passes a continuation to the child allocate that will set the current bitmap if the child bitmap is now all set. It will also lazily create the children or parents as necessary.
void
Deallocates a counter by deallocating the corresponding child. Passes a continuation to the child deallocate that will unset the current bitmap if the child bitmap was previously all set. It can also shrink the tree if the child node is compeletely empty or if the child leaf is completely unset.
void
Class representing allocatable and deallocatable counters. Counters are allocated in sequential manner, this applies to deallocated counters. Once a counter is deallocated, it will be reused on the next allocation. This is a mutable counter, which doesn't use snapshots.
Allocates a counter sequentially. If a counter is specified, it will allocate it explicitly and return a changed boolean.
(number?)
[(boolean | number), CounterImmutable]
Deallocates a number, it makes it available for reuse.
(number)
[boolean, CounterImmutable]
Takes a callback that performs a set of operations. And only returns the new immutable counter at the end of all operations. This is useful if you want to batch up modfications to the counter.
(function (CounterTransaction): any)
CounterImmutable
Class representing allocatable and deallocatable counters. Counters are allocated in sequential manner, this applies to deallocated counters. Once a counter is deallocated, it will be reused on the next allocation. This is an immutable counter. It will return a new counter on mutation.
Allocates a counter sequentially. If a counter is specified, it will allocate it explicitly and return a changed boolean.
(number?)
[(boolean | number), CounterImmutable]
Deallocates a number, it makes it available for reuse.
(number)
[boolean, CounterImmutable]
Takes a callback that performs a set of operations. And only returns the new immutable counter at the end of all operations. This is useful if you want to batch up modfications to the counter.
(function (CounterTransaction): any)
CounterImmutable