MutableMultiMap

@Serializable
class MutableMultiMap<K, V> : MultiMap<K, V>

Functions

Link copied to clipboard
fun addAll(key: K, vararg values: V)

Adds all the supplied values to this key-value.

Link copied to clipboard
fun clear()

Removes all the mappings from this multimap.

fun clear(onRemove: (K, V) -> Unit)

Clears this multimap of all mappings.

Link copied to clipboard
open override fun containsKey(key: Any?): Boolean

Returns true if this multimap contains a mapping for the specified key.

Link copied to clipboard
open override fun forEach(block: (K, Collection<V>?) -> Unit)
Link copied to clipboard
open override fun forEachIndexed(block: (index: Int, K, Collection<V>?) -> Unit)
Link copied to clipboard
open operator override fun get(key: K?): MutableCollection<V>?

Returns the Collection of values to which the specified key is mapped, or null if this multimap contains no mapping for the key.

Link copied to clipboard
operator fun minusAssign(key: K)

Removes this key (and its corresponding value) from this multimap.

operator fun minusAssign(value: Pair<K, V>)

Removes the specified value with the specified key in this multimap.

Link copied to clipboard
operator fun plusAssign(value: Pair<K, V>)

Adds the specified value with the specified key in this multimap.

Link copied to clipboard
fun put(key: K, value: V)

Add the specified value with the specified key in this multimap.

Link copied to clipboard
fun putIfAbsent(key: K, value: V)

Associate the specified key with the given value if this key is not present within the multimap.

Link copied to clipboard
fun remove(key: Any?): ImmutableSet<V>?

Removes the mapping for the specified key from this multimap if present and returns the Collection of previous values associated with key, or null if there was no mapping for key.

fun remove(key: K, value: V): Boolean

Removes the entry for the specified key only if it is currently mapped to the specified value and return true if removed.

fun remove(key: Any?, onRemove: (V) -> Unit): Boolean

Removes the mapping for the specified key from the multimap if present.

Link copied to clipboard
fun replace(key: K, oldValue: V, newValue: V): Boolean

Replaces the entry for the specified key only if currently mapped to the specified value and return true if replaced.

Link copied to clipboard
open override fun size(): Int

Gets the total size of all elements within this multimap.

Properties

Link copied to clipboard
open override val entries: ImmutableSet<MutableMap.MutableEntry<K, MutableSet<V>>>

Returns a Set view of the mappings contained in this multimap.

Link copied to clipboard
open override val isEmpty: Boolean

Returns true if this multimap contains no key-value pairs.

Link copied to clipboard
open override val keys: ImmutableSet<K>

Returns a Set view of the keys contained in this multimap.

Link copied to clipboard
open override val size: Int

Returns the number of key-value pairs in this multimap.

Link copied to clipboard
open override val values: ImmutableSet<MutableSet<V>>

Returns a Collection view of the values present in this multimap.