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

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

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

Constructors

new
MultiSetNonEmpty(
context: TpG["context"],
countMap: TpG["countMapNonEmpty"],
size: number,
)

Type Parameters

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

Properties

readonly
sizeDistinct: number

Methods

add(elem: T, amount?): WithElem<Tp, T>["nonEmpty"]
addAll(values: StreamSource<T>): TpG["nonEmpty"]
addEntries(entries: StreamSource<readonly [T, number]>): TpG["nonEmpty"]
asNormal(): any
copy(countMap: TpG["countMapNonEmpty"], size: number): TpG["nonEmpty"]
copyE(countMap: TpG["countMap"], size: number): TpG["normal"]
count<U>(elem: RelatedTo<T, U>): number
filterEntries(pred: (entry: readonly [T, number], index: number) => boolean): TpG["normal"]
forEach(f: (
value: T,
index: number,
halt: () => void,
) => void
, state?: TraverseState
): void
has<U>(elem: RelatedTo<T, U>): boolean
modifyCount(value: T, update: (currentCount: number) => number): TpG["normal"]
remove<U>(elem: RelatedTo<T, U>, amount?: number | "ALL"): TpG["normal"]
removeAllEvery<U>(elems: StreamSource<RelatedTo<T, U>>): TpG["normal"]
removeAllSingle<U>(elems: StreamSource<RelatedTo<T, U>>): TpG["normal"]
setCount(elem: T, amount: number): TpG["normal"]
stream(): Stream.NonEmpty<T>
streamDistinct(): Stream.NonEmpty<T>
toBuilder(): TpG["builder"]
toJSON(): ToJSON<(readonly [T, number])[]>
toString(): string