Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/rimbu/multiset/custom/implementation/base.ts>MultiSetBuilder

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
class MultiSetBuilder
implements [MultiSetBase.Builder]<T, Tp>
import { MultiSetBuilder } from "https://deno.land/x/rimbu@1.0.0/multiset/custom/implementation/base.ts";

Constructors

new
MultiSetBuilder(context: TpG["context"], source?: TpG["nonEmpty"])

Type Parameters

T
Tp extends ContextImplTypes
optional
TpG extends WithElem<Tp, T> = WithElem<Tp, T>

Properties

optional
_countMap: RMap.Builder<T, number>
_lock: number
_size: number
add: (value: T, amount?) => boolean
addAll: (source: StreamSource<T>) => boolean
addEntries: (entries: StreamSource<readonly [T, number]>) => boolean
build: () => TpG["normal"]
count: <U>(value: RelatedTo<T, U>) => number
readonly
countMap: RMap.Builder<T, number>
forEach: (f: (
value: T,
index: number,
halt: () => void,
) => void
, state?: TraverseState
) => void
has: <U>(value: RelatedTo<T, U>) => boolean
readonly
isEmpty: boolean
modifyCount: (value: T, update: (currentCount: number) => number) => boolean
remove: <U>(value: RelatedTo<T, U>, amount?: number | "ALL") => number
removeAll: <U>(values: StreamSource<RelatedTo<T, U>>, mode: "SINGLE" | "ALL") => boolean
removeAllEvery: <U>(values: StreamSource<RelatedTo<T, U>>) => boolean
removeAllSingle: <U>(values: StreamSource<RelatedTo<T, U>>) => boolean
setCount: (value: T, amount: number) => boolean
readonly
size: number
readonly
sizeDistinct: number