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

x/rimbu/multimap/custom/implementation/base.ts>MultiMapNonEmpty

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

Constructors

new
MultiMapNonEmpty(
context: TpG["context"],
keyMap: TpG["keyMapNonEmpty"],
size: number,
)

Type Parameters

K
V
Tp extends ContextImplTypes
optional
TpG extends WithKeyValue<Tp, K, V> = WithKeyValue<Tp, K, V>

Properties

readonly
keySize: number

Methods

add(key: K, value: V): TpG["nonEmpty"]
addEntries(entries: StreamSource<readonly [K, V]>): TpG["nonEmpty"]
asNormal(): any
copy(keyMap: TpG["keyMapNonEmpty"], size: number): TpG["nonEmpty"]
copyE(keyMap: TpG["keyMap"], size: number): TpG["normal"]
filter(pred: (
entry: [K, V],
index: number,
halt: () => void,
) => boolean
): TpG["normal"]
forEach(f: (
entry: [K, V],
index: number,
halt: () => void,
) => void
, state?
): void
getValues<U>(key: RelatedTo<K, U>): TpG["keyMapValues"]
hasEntry<U>(key: RelatedTo<K, U>, value: V): boolean
hasKey<U>(key: RelatedTo<K, U>): boolean
modifyAt(atKey: K, options: { ifNew?: OptLazy<StreamSource<V>>; ifExists?: (currentValues: TpG["keyMapValuesNonEmpty"]) => StreamSource<V>; }): TpG["normal"]
removeEntries<UK, UV>(entries: StreamSource<[RelatedTo<K, UK>, RelatedTo<V, UV>]>): TpG["normal"]
removeEntry<UK, UV>(key: RelatedTo<K, UK>, value: RelatedTo<V, UV>): TpG["normal"]
removeKey<UK>(key: RelatedTo<K, UK>): TpG["normal"]
removeKeyAndGet<UK>(key: RelatedTo<K, UK>): [TpG["normal"], TpG["keyMapValuesNonEmpty"]] | undefined
removeKeys<UK>(keys: StreamSource<RelatedTo<K, UK>>): TpG["normal"]
setValues(key: K, values: any): any
stream(): Stream.NonEmpty<[K, V]>
streamKeys(): Stream.NonEmpty<K>
streamValues(): Stream.NonEmpty<V>
toBuilder(): TpG["builder"]
toJSON(): ToJSON<[K, V[]][]>
toString(): string