# Class BidirectionalMap<K, T>

Biderctional map. Its a normal map but by using the reverse property it is possible to perform lookups in the "reverse" direction.

#### Type Parameters

- K
- T

#### Implements

- Map<K, T>

##### Index

### Constructors

constructor

### Accessors

[toStringTag]
reverse
size

### Methods

[iterator]
clear
delete
entries
forEach
get
getOrAdd
has
keys
set
values

## Constructors

### constructor

- new BidirectionalMap<K, T>(
  parent?: BidirectionalMap<T, K>,
  ): BidirectionalMap<K, T>

  #### Type Parameters

  - K
  - T

  #### Parameters

  - `Optional` parent: BidirectionalMap<T, K>

  #### Returns BidirectionalMap<K, T>

## Accessors

### [toStringTag]

- get "[toStringTag]"(): string

  See Map

  #### Returns string

  Implementation of Map.[toStringTag]

### reverse

- get reverse(): Map<T, K>

  #### Returns Map<T, K>

### size

- get size(): number

  See Map

  #### Returns number

  Implementation of Map.size

## Methods

### [iterator]

- "[iterator]"(): MapIterator<[K, T]>

  See Map

  #### Returns MapIterator<[K, T]>

  Implementation of Map.[iterator]

### clear

- clear(): void

  See Map

  #### Returns void

  Implementation of Map.clear

### delete

- delete(key: K): boolean

  See Map

  #### Parameters

  - key: K

  #### Returns boolean

  Implementation of Map.delete

### entries

- entries(): MapIterator<[K, T]>

  See Map

  #### Returns MapIterator<[K, T]>

  Implementation of Map.entries

### forEach

- forEach(
  callbackfn: (value: T, key: K, map: Map<K, T>) => void,
  thisArg?: any,
  ): void

  See Map

  #### Parameters

  - callbackfn: (value: T, key: K, map: Map<K, T>) => void
  - `Optional` thisArg: any

  #### Returns void

  Implementation of Map.forEach

### get

- get(key: K): undefined | T

  See Map

  #### Parameters

  - key: K

  #### Returns undefined | T

  Implementation of Map.get

### getOrAdd

- getOrAdd(key: K, factory: (key: K) => T): T

  If key exists returns the existing value. Otherwise factory is called and the resulting value is added to the key.

  #### Parameters

  - key: K

    Key to check for value

  - factory: (key: K) => T

    Factory which creates value if key does not exist in map.

  #### Returns T

  value for key

  Implementation of Map.getOrAdd

### has

- has(key: K): boolean

  See Map

  #### Parameters

  - key: K

  #### Returns boolean

  Implementation of Map.has

### keys

- keys(): MapIterator<K>

  See Map

  #### Returns MapIterator<K>

  Implementation of Map.keys

### set

- set(key: K, value: T): this

  See Map

  #### Parameters

  - key: K
  - value: T

  #### Returns this

  Implementation of Map.set

### values

- values(): MapIterator<T>

  See Map

  #### Returns MapIterator<T>

  Implementation of Map.values