# Class: CachedMap<K, V> (/pixi-vn/index/classes/CachedMap)



Defined in: [src/classes/CachedMap.ts:3](https://github.com/DRincs-Productions/pixi-vn/blob/5bb5bb1f92e38998ea2f477b600168d8da3ece19/src/classes/CachedMap.ts#L3)

## Type Parameters [#type-parameters]

### K [#k]

`K` *extends* `object`

### V [#v]

`V` *extends* `object`

## Implements [#implements]

* `Map`\<`K`, `V`>

## Constructors [#constructors]

### Constructor [#constructor]

\> **new CachedMap**\<`K`, `V`>(`options`): `CachedMap`\<`K`, `V`>

Defined in: [src/classes/CachedMap.ts:6](https://github.com/DRincs-Productions/pixi-vn/blob/5bb5bb1f92e38998ea2f477b600168d8da3ece19/src/classes/CachedMap.ts#L6)

#### Parameters [#parameters]

##### options [#options]

###### cacheSize [#cachesize]

`number`

#### Returns [#returns]

`CachedMap`\<`K`, `V`>

## Properties [#properties]

### cache [#cache]

\> `readonly` **cache**: `LRUCache`\<`K`, `V`>

Defined in: [src/classes/CachedMap.ts:4](https://github.com/DRincs-Productions/pixi-vn/blob/5bb5bb1f92e38998ea2f477b600168d8da3ece19/src/classes/CachedMap.ts#L4)

***

### map [#map]

\> `readonly` **map**: `Map`\<`K`, `V`>

Defined in: [src/classes/CachedMap.ts:5](https://github.com/DRincs-Productions/pixi-vn/blob/5bb5bb1f92e38998ea2f477b600168d8da3ece19/src/classes/CachedMap.ts#L5)

## Accessors [#accessors]

### \[iterator] [#iterator]

#### Get Signature [#get-signature]

\> **get** **\[iterator]**(): () => `MapIterator`\<\[`K`, `V`]>

Defined in: [src/classes/CachedMap.ts:12](https://github.com/DRincs-Productions/pixi-vn/blob/5bb5bb1f92e38998ea2f477b600168d8da3ece19/src/classes/CachedMap.ts#L12)

##### Returns [#returns-1]

\> (): `MapIterator`\<\[`K`, `V`]>

Returns an iterable of entries in the map.

###### Returns [#returns-2]

`MapIterator`\<\[`K`, `V`]>

#### Implementation of [#implementation-of]

`Map.[iterator]`

***

### \[toStringTag] [#tostringtag]

#### Get Signature [#get-signature-1]

\> **get** **\[toStringTag]**(): `string`

Defined in: [src/classes/CachedMap.ts:15](https://github.com/DRincs-Productions/pixi-vn/blob/5bb5bb1f92e38998ea2f477b600168d8da3ece19/src/classes/CachedMap.ts#L15)

##### Returns [#returns-3]

`string`

#### Implementation of [#implementation-of-1]

`Map.[toStringTag]`

***

### forEach [#foreach]

#### Get Signature [#get-signature-2]

\> **get** **forEach**(): (`callbackfn`, `thisArg?`) => `void`

Defined in: [src/classes/CachedMap.ts:29](https://github.com/DRincs-Productions/pixi-vn/blob/5bb5bb1f92e38998ea2f477b600168d8da3ece19/src/classes/CachedMap.ts#L29)

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

##### Returns [#returns-4]

\> (`callbackfn`, `thisArg?`): `void`

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

###### Parameters [#parameters-1]

###### callbackfn [#callbackfn]

(`value`, `key`, `map`) => `void`

###### thisArg? [#thisarg]

`any`

###### Returns [#returns-5]

`void`

#### Implementation of [#implementation-of-2]

`Map.forEach`

***

### size [#size]

#### Get Signature [#get-signature-3]

\> **get** **size**(): `number`

Defined in: [src/classes/CachedMap.ts:47](https://github.com/DRincs-Productions/pixi-vn/blob/5bb5bb1f92e38998ea2f477b600168d8da3ece19/src/classes/CachedMap.ts#L47)

##### Returns [#returns-6]

`number`

the number of elements in the Map.

#### Implementation of [#implementation-of-3]

`Map.size`

## Methods [#methods]

### clear() [#clear]

\> **clear**(): `void`

Defined in: [src/classes/CachedMap.ts:18](https://github.com/DRincs-Productions/pixi-vn/blob/5bb5bb1f92e38998ea2f477b600168d8da3ece19/src/classes/CachedMap.ts#L18)

#### Returns [#returns-7]

`void`

#### Implementation of [#implementation-of-4]

`Map.clear`

***

### delete() [#delete]

\> **delete**(`key`): `boolean`

Defined in: [src/classes/CachedMap.ts:22](https://github.com/DRincs-Productions/pixi-vn/blob/5bb5bb1f92e38998ea2f477b600168d8da3ece19/src/classes/CachedMap.ts#L22)

#### Parameters [#parameters-2]

##### key [#key]

`K`

#### Returns [#returns-8]

`boolean`

true if an element in the Map existed and has been removed, or false if the element does not exist.

#### Implementation of [#implementation-of-5]

`Map.delete`

***

### entries() [#entries]

\> **entries**(): `MapIterator`\<\[`K`, `V`]>

Defined in: [src/classes/CachedMap.ts:50](https://github.com/DRincs-Productions/pixi-vn/blob/5bb5bb1f92e38998ea2f477b600168d8da3ece19/src/classes/CachedMap.ts#L50)

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

#### Returns [#returns-9]

`MapIterator`\<\[`K`, `V`]>

#### Implementation of [#implementation-of-6]

`Map.entries`

***

### get() [#get]

\> **get**(`key`): `V` | `undefined`

Defined in: [src/classes/CachedMap.ts:32](https://github.com/DRincs-Productions/pixi-vn/blob/5bb5bb1f92e38998ea2f477b600168d8da3ece19/src/classes/CachedMap.ts#L32)

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 [#parameters-3]

##### key [#key-1]

`K`

#### Returns [#returns-10]

`V` | `undefined`

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

#### Implementation of [#implementation-of-7]

`Map.get`

***

### has() [#has]

\> **has**(`key`): `boolean`

Defined in: [src/classes/CachedMap.ts:39](https://github.com/DRincs-Productions/pixi-vn/blob/5bb5bb1f92e38998ea2f477b600168d8da3ece19/src/classes/CachedMap.ts#L39)

#### Parameters [#parameters-4]

##### key [#key-2]

`K`

#### Returns [#returns-11]

`boolean`

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

#### Implementation of [#implementation-of-8]

`Map.has`

***

### keys() [#keys]

\> **keys**(): `MapIterator`\<`K`>

Defined in: [src/classes/CachedMap.ts:53](https://github.com/DRincs-Productions/pixi-vn/blob/5bb5bb1f92e38998ea2f477b600168d8da3ece19/src/classes/CachedMap.ts#L53)

Returns an iterable of keys in the map

#### Returns [#returns-12]

`MapIterator`\<`K`>

#### Implementation of [#implementation-of-9]

`Map.keys`

***

### set() [#set]

\> **set**(`key`, `value`): `this`

Defined in: [src/classes/CachedMap.ts:42](https://github.com/DRincs-Productions/pixi-vn/blob/5bb5bb1f92e38998ea2f477b600168d8da3ece19/src/classes/CachedMap.ts#L42)

Adds a new element with a specified key and value to the Map. If an element with the same key already exists, the element will be updated.

#### Parameters [#parameters-5]

##### key [#key-3]

`K`

##### value [#value]

`V`

#### Returns [#returns-13]

`this`

#### Implementation of [#implementation-of-10]

`Map.set`

***

### values() [#values]

\> **values**(): `MapIterator`\<`V`>

Defined in: [src/classes/CachedMap.ts:56](https://github.com/DRincs-Productions/pixi-vn/blob/5bb5bb1f92e38998ea2f477b600168d8da3ece19/src/classes/CachedMap.ts#L56)

Returns an iterable of values in the map

#### Returns [#returns-14]

`MapIterator`\<`V`>

#### Implementation of [#implementation-of-11]

`Map.values`
