# Class Collection<K, V>

支持Map与Array功能的集合对象

#### Type Parameters

- #### K

- #### V

#### Hierarchy

- Map<K, V>
  - Collection

- Defined in assets/libs/collection/Collection.ts:9

#####
Index

### Constructors

constructor

### Properties

[toStringTag]
_array
size
[species]

### Accessors

array

### Methods

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

## Constructors

### constructor

- new Collection<K, V>(entries?: null | readonly (readonly [K, V])[]): Collection <K, V>

- #### Type Parameters

  - #### K

  - #### V

  #### Parameters

  - ##### `Optional` entries: null | readonly (readonly [K, V])[]

  #### Returns Collection <K, V>

  Inherited from Map<K, V>.constructor

  - Defined in node_modules/typescript/lib/lib.es2015.collection.d.ts:53
- new Collection<K, V>(iterable?: null | Iterable<readonly [K, V]>): Collection <K, V>

- #### Type Parameters

  - #### K

  - #### V

  #### Parameters

  - ##### `Optional` iterable: null | Iterable<readonly [K, V]>

  #### Returns Collection <K, V>

  Inherited from Map<K, V>.constructor

  - Defined in node_modules/typescript/lib/lib.es2015.iterable.d.ts:161

## Properties

### `Readonly` [toStringTag]

[toStringTag]: string

Inherited from Map.__@toStringTag@50

- Defined in node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:135

### `Private` _array

_array: V[] = []

- Defined in assets/libs/collection/Collection.ts:10

### `Readonly` size

size: number

### Returns

the number of elements in the Map.

Inherited from Map.size

- Defined in node_modules/typescript/lib/lib.es2015.collection.d.ts:48

### `Static` `Readonly` [species]

[species]: MapConstructor

Inherited from Map.__@species@42

- Defined in node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:317

## Accessors

### array

- get array(): V[]

- 获取数组对象

  #### Returns V[]

  - Defined in assets/libs/collection/Collection.ts:13

## Methods

### [iterator]

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

- Returns an iterable of entries in the map.

  #### Returns IterableIterator<[K, V]>

  Inherited from Map.__@iterator@48

  - Defined in node_modules/typescript/lib/lib.es2015.iterable.d.ts:121

### clear

- clear(): void

- #### Returns void

  Overrides Map.clear

  - Defined in assets/libs/collection/Collection.ts:49

### delete

- delete(key: K): boolean

- 删除值

  #### Parameters

  - ##### key: K

    关键字

  #### Returns boolean

  Overrides Map.delete

  - Defined in assets/libs/collection/Collection.ts:39

### 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/typescript/lib/lib.es2015.iterable.d.ts:126

### forEach

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

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

  #### Parameters

  - ##### callbackfn: ((value: V, key: K, map: Map<K, V>) => void)

    - - (value: V, key: K, map: Map<K, V>): void

      - #### Parameters

        - ##### value: V

        - ##### key: K

        - ##### map: Map<K, V>

        #### Returns void

  - ##### `Optional` thisArg: any

  #### Returns void

  Inherited from Map.forEach

  - Defined in node_modules/typescript/lib/lib.es2015.collection.d.ts:31

### get

- get(key: K): undefined | 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.

  ### Returns

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

  #### Parameters

  - ##### key: K

  #### Returns undefined | V

  Inherited from Map.get

  - Defined in node_modules/typescript/lib/lib.es2015.collection.d.ts:36

### has

- has(key: K): boolean

- ### Returns

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

  #### Parameters

  - ##### key: K

  #### Returns boolean

  Inherited from Map.has

  - Defined in node_modules/typescript/lib/lib.es2015.collection.d.ts:40

### keys

- keys(): IterableIterator<K>

- Returns an iterable of keys in the map

  #### Returns IterableIterator<K>

  Inherited from Map.keys

  - Defined in node_modules/typescript/lib/lib.es2015.iterable.d.ts:131

### set

- set(key: K, value: V): Collection <K, V>

- 设置值

  #### Parameters

  - ##### key: K

    关键字

  - ##### value: V

    数据值

  #### Returns Collection <K, V>

  Overrides Map.set

  - Defined in assets/libs/collection/Collection.ts:22

### values

- values(): IterableIterator<V>

- Returns an iterable of values in the map

  #### Returns IterableIterator<V>

  Inherited from Map.values

  - Defined in node_modules/typescript/lib/lib.es2015.iterable.d.ts:136

Generated using TypeDoc