ConcurrentMap

class ConcurrentMap<Key, Value>(initialCapacity: Int = 16) : MutableMap<Key, Value> (source)

A thread-safe MutableMap for Kotlin/Native, based on a LinkedHashMap protected by a ReentrantLock.

Constructors

Link copied to clipboard
constructor(initialCapacity: Int = 16)

Properties

Link copied to clipboard
Link copied to clipboard
open override val keys: MutableSet<Key>
Link copied to clipboard
open override val size: Int
Link copied to clipboard
open override val values: MutableCollection<Value>

Functions

Link copied to clipboard
open override fun clear()
Link copied to clipboard
fun computeIfAbsent(key: Key, block: () -> Value): Value

Computes block and inserts the result in the map under key if key does not yet have a mapping. The block will be evaluated at most once.

Link copied to clipboard
fun computeIfPresent(key: Key, remappingFunction: (Key, Value) -> Value?): Value?

If the value for the specified key is present, attempts to compute a new mapping given the key and its current mapped value. This entire method invocation is performed atomically.

Link copied to clipboard
open override fun containsKey(key: Key): Boolean
Link copied to clipboard
open override fun containsValue(value: Value): Boolean
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open operator override fun get(key: Key): Value?
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun isEmpty(): Boolean
Link copied to clipboard
open override fun put(key: Key, value: Value): Value?
Link copied to clipboard
open override fun putAll(from: Map<out Key, Value>)
Link copied to clipboard
fun putIfAbsent(key: Key, value: Value): Value?

Maps the specified key to value if it is not already mapped. If the map already contains a value for key, it returns the existing value and does not modify the map.

Link copied to clipboard
open override fun remove(key: Key): Value?

fun remove(key: Key, value: Value): Boolean

Removes the entry key ->value if it exists, returning true if removed.

Link copied to clipboard
open override fun toString(): String