Skip to main content

class HashMapEmpty<K,V>

undocumented

Extends: EmptyBase

Type parameters​

NameDefaultDescription
Kanyundocumented
Vanyundocumented

Properties​

_NonEmptyType​

undocumented

Definition​

_NonEmptyType: HashMap.NonEmpty<K, V>;

Overrides​

EmptyBase._NonEmptyType

context​

undocumented

Definition​

readonly context: HashMapContext<K>;

isEmpty​

Returns true since the collection is empty.

Definition​

get isEmpty(): true;

Overrides​

EmptyBase.isEmpty

length​

Returns 0 for the length of the collection.

Definition​

get length(): 0;

Overrides​

EmptyBase.length

size​

Returns 0 for the size of the collection.

Definition​

get size(): 0;

Overrides​

EmptyBase.size

Methods​

[Symbol.iterator]​

Returns an empty iterator.

Definition​

[Symbol.iterator](): FastIterator<any>;

Overrides​

EmptyBase.[Symbol.iterator]

addEntries​

undocumented

Definition​

addEntries(entries: StreamSource<readonly [K, V]>): HashMap.NonEmpty<K, V>;

Parameters​

NameTypeDescription
entriesStreamSource<readonly [K, V]>

addEntry​

undocumented

Definition​

addEntry(entry: readonly [K, V]): HashMap.NonEmpty<K, V>;

Parameters​

NameTypeDescription
entryreadonly [K, V]

assumeNonEmpty​

Throws a RimbuError.EmptyCollectionAssumedNonEmptyError, since the collection is empty.

Definition​

assumeNonEmpty(): never;

throws

RimbuError.EmptyCollectionAssumedNonEmptyError

Overrides​

EmptyBase.assumeNonEmpty

filter​

Returns this, since filtering an empty collection is still empty.

Definition​

filter(): any;

Overrides​

EmptyBase.filter

forEach​

Performs no action, since there are no elements.

Definition​

forEach(): void;

Overrides​

EmptyBase.forEach

get​

undocumented

Definition​

get<_, O>(key: K, otherwise?: OptLazy<O>): O;

Type parameters​

NameDescription
_
O

Parameters​

NameTypeDescription
keyK
otherwiseOptLazy<O>

hasKey​

undocumented

Definition​

hasKey(): false;

mapValues​

undocumented

Definition​

mapValues<V2>(): HashMap<K, V2>;

Type parameters​

NameDescription
V2

modifyAt​

undocumented

Definition​

modifyAt(atKey: K, options: {
    ifNew?: OptLazyOr<V, Token>;
  }): HashMap<K, V>;

Parameters​

NameTypeDescription
atKeyK
options{
    ifNew?: OptLazyOr<V, Token>;
  }

nonEmpty​

Returns false, keeping the type narrowed to the empty variant.

Definition​

nonEmpty(): this is this['_NonEmptyType'];

Overrides​

EmptyBase.nonEmpty

remove​

Returns this, since removing from an empty collection has no effect.

Definition​

remove(): any;

Overrides​

EmptyBase.remove

removeKey​

undocumented

Definition​

removeKey(): HashMap<K, V>;

removeKeyAndGet​

undocumented

Definition​

removeKeyAndGet(): undefined;

removeKeys​

undocumented

Definition​

removeKeys(): HashMap<K, V>;

set​

undocumented

Definition​

set(key: K, value: V): HashMap.NonEmpty<K, V>;

Parameters​

NameTypeDescription
keyK
valueV

stream​

Returns an empty Stream.

Definition​

stream(): Stream<any>;

Overrides​

EmptyBase.stream

streamKeys​

undocumented

Definition​

streamKeys(): Stream<K>;

streamValues​

undocumented

Definition​

streamValues(): Stream<V>;

toArray​

Returns an empty array.

Definition​

toArray(): [];

Overrides​

EmptyBase.toArray

toBuilder​

undocumented

Definition​

toBuilder(): HashMap.Builder<K, V>;

toJSON​

undocumented

Definition​

toJSON(): ToJSON<(readonly [K, V])[]>;

toString​

undocumented

Definition​

toString(): string;

updateAt​

undocumented

Definition​

updateAt(): HashMap<K, V>;