# Class: AsyncMap

## vertx-js/async_map~ AsyncMap

#### new AsyncMap()

An asynchronous map.

Source:
  - vertx-js/async_map.js, line 30

### Methods

#### clear(resultHandler)

Clear all entries in the map

##### Parameters:

Name | Type | Description
--- | --- | ---
`resultHandler` | function | called on completion

Source:
  - vertx-js/async_map.js, line 209

#### get(k, resultHandler)

Get a value from the map, asynchronously.

##### Parameters:

Name | Type | Description
--- | --- | ---
`k` | Object | the key
`resultHandler` | function | this will be called some time later with the async result.

Source:
  - vertx-js/async_map.js, line 44

#### put(k, v, ttl, completionHandler)

Like AsyncMap#put but specifying a time to live for the entry. Entry will expire and get evicted after the ttl.

##### Parameters:

Name | Type | Description
--- | --- | ---
`k` | Object | the key
`v` | Object | the value
`ttl` | number | The time to live (in ms) for the entry
`completionHandler` | function | the handler

Source:
  - vertx-js/async_map.js, line 67

#### putIfAbsent(k, v, ttl, completionHandler)

Link AsyncMap#putIfAbsent but specifying a time to live for the entry. Entry will expire and get evicted after the ttl.

##### Parameters:

Name | Type | Description
--- | --- | ---
`k` | Object | the key
`v` | Object | the value
`ttl` | number | The time to live (in ms) for the entry
`completionHandler` | function | the handler

Source:
  - vertx-js/async_map.js, line 98

#### remove(k, resultHandler)

Remove a value from the map, asynchronously.

##### Parameters:

Name | Type | Description
--- | --- | ---
`k` | Object | the key
`resultHandler` | function | this will be called some time later to signify the value has been removed

Source:
  - vertx-js/async_map.js, line 126

#### removeIfPresent(k, v, resultHandler)

Remove a value from the map, only if entry already exists with same value.

##### Parameters:

Name | Type | Description
--- | --- | ---
`k` | Object | the key
`v` | Object | the value
`resultHandler` | function | this will be called some time later to signify the value has been removed

Source:
  - vertx-js/async_map.js, line 147

#### replace(k, v, resultHandler)

Replace the entry only if it is currently mapped to some value

##### Parameters:

Name | Type | Description
--- | --- | ---
`k` | Object | the key
`v` | Object | the new value
`resultHandler` | function | the result handler will be passed the previous value

Source:
  - vertx-js/async_map.js, line 168

#### replaceIfPresent(k, oldValue, newValue, resultHandler)

Replace the entry only if it is currently mapped to a specific value

##### Parameters:

Name | Type | Description
--- | --- | ---
`k` | Object | the key
`oldValue` | Object | the existing value
`newValue` | Object | the new value
`resultHandler` | function | the result handler

Source:
  - vertx-js/async_map.js, line 190

#### size(resultHandler)

Provide the number of entries in the map

##### Parameters:

Name | Type | Description
--- | --- | ---
`resultHandler` | function | handler which will receive the number of entries

Source:
  - vertx-js/async_map.js, line 228