ConcurrentMap

class ConcurrentMap<Key, Value> : MutableMap<Key, Value>

Constructors

<init>

ConcurrentMap(
    lock: Lock = Lock(),
    delegate: MutableMap<Key, Value> = mutableMapOf<Key, Value>())

Properties

entries

val entries: MutableSet<MutableEntry<Key, Value>>

keys

val keys: MutableSet<Key>

size

val size: Int

values

Functions

clear

fun clear(): Unit

computeIfAbsent

fun computeIfAbsent(key: Key, block: () -> Value): Value

Perform concurrent get and compute block if no associated value found in the map and insert the new value.

containsKey

fun containsKey(key: Key): Boolean

containsValue

fun containsValue(value: Value): Boolean

get

fun get(key: Key): Value?

getOrDefault

fun getOrDefault(key: Key, block: () -> Value): Value

Perform concurrent insert.

isEmpty

fun isEmpty(): Boolean

put

fun put(key: Key, value: Value): Value?

putAll

fun putAll(from: Map<out Key, Value>): Unit

remove

fun remove(key: Key): Value?