# 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 207

#### 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 42

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

Like AsyncMap#put but specifying a timeout. If the value cannot be put within the timeout a failure will be passed to the handler

##### 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 65

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

Link AsyncMap#putIfAbsent but specifying a timeout. If the value cannot be put within the timeout a failure will be passed to the handler

##### 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 96

#### 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 124

#### 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 145

#### 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 166

#### 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 188

#### 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 226