Skip to content

Class: BiMap<K, V>

Type parameters

Name
K
V

Hierarchy

  • Map<K, V>

    BiMap

Constructors

Properties

Methods

Constructors

constructor

new BiMap<K, V>(iterable?): BiMap<K, V>

Type parameters

Name
K
V

Parameters

NameType
iterable?Iterable<readonly [K, V]>

Returns

BiMap<K, V>

Overrides

Map&lt;K, V&gt;.constructor

Defined in

src/math/BiMap.ts:4

Properties

size

Readonly size: number

Inherited from

Map.size

Defined in

node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2015.collection.d.ts:45


[toStringTag]

Readonly [toStringTag]: string

Inherited from

Map.[toStringTag]

Defined in

node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:137


[species]

Static Readonly [species]: MapConstructor

Inherited from

Map.[species]

Defined in

node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:319

Methods

forEach

forEach(callbackfn, thisArg?): void

Executes a provided function once per each key/value pair in the Map, in insertion order.

Parameters

NameType
callbackfn(value: V, key: K, map: Map<K, V>) => void
thisArg?any

Returns

void

Inherited from

Map.forEach

Defined in

node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2015.collection.d.ts:28


get

get(key): V

Returns a specified element from the Map object. If the value that is associated to the provided key is an object, then you will get a reference to that object and any change made to that object will effectively modify it inside the Map.

Parameters

NameType
keyK

Returns

V

Returns the element associated with the specified key. If no element is associated with the specified key, undefined is returned.

Inherited from

Map.get

Defined in

node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2015.collection.d.ts:33


has

has(key): boolean

Parameters

NameType
keyK

Returns

boolean

boolean indicating whether an element with the specified key exists or not.

Inherited from

Map.has

Defined in

node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2015.collection.d.ts:37


[iterator]

[iterator](): IterableIterator<[K, V]>

Returns an iterable of entries in the map.

Returns

IterableIterator<[K, V]>

Inherited from

Map.[iterator]

Defined in

node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts:119


entries

entries(): IterableIterator<[K, V]>

Returns an iterable of key, value pairs for every entry in the map.

Returns

IterableIterator<[K, V]>

Inherited from

Map.entries

Defined in

node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts:124


keys

keys(): IterableIterator<K>

Returns an iterable of keys in the map

Returns

IterableIterator<K>

Inherited from

Map.keys

Defined in

node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts:129


values

values(): IterableIterator<V>

Returns an iterable of values in the map

Returns

IterableIterator<V>

Inherited from

Map.values

Defined in

node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts:134


delete

delete(key): boolean

Parameters

NameType
keyK

Returns

boolean

Overrides

Map.delete

Defined in

src/math/BiMap.ts:13


getKey

getKey(value): K

Parameters

NameType
valueV

Returns

K

Defined in

src/math/BiMap.ts:22


deleteValue

deleteValue(value): boolean

Parameters

NameType
valueV

Returns

boolean

Defined in

src/math/BiMap.ts:26


set

set(key, value): this

Parameters

NameType
keyK
valueV

Returns

this

Overrides

Map.set

Defined in

src/math/BiMap.ts:32


clear

clear(): void

Returns

void

Overrides

Map.clear

Defined in

src/math/BiMap.ts:38