MapBase

abstract class MapBase<K, V, MT : MapType<K, V, MT, MMT>, MMT : MutableMapType<K, V, MT, MMT>>(val map: Map<K, V>) : MapType<K, V, MT, MMT> (source)

A base API class for an implementation of MapType

Since

0.1.0

Inheritors

Constructors

Link copied to clipboard
constructor(map: Map<K, V>)

Properties

Link copied to clipboard
open override val entries: Set<Map.Entry<K, V>>

Returns a read-only Set of all key/value pairs in this map.

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

Returns a read-only Collection of all values in this map. Note that this collection may contain duplicate values.

Link copied to clipboard
val map: Map<K, V>

The Map to create the MapBase from

Link copied to clipboard
open override val size: Int

Returns the number of key/value pairs in the map.

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

Returns a read-only Collection of all values in this map. Note that this collection may contain duplicate values.

Functions

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

Returns true if the map contains the specified key.

Link copied to clipboard
open override fun containsValue(value: V): Boolean

Returns true if the map maps one or more keys to the specified value.

Link copied to clipboard
open operator override fun get(key: K): V?

Returns the value corresponding to the given key, or null if such a key is not present in the map.

Link copied to clipboard
open override fun isEmpty(): Boolean

Returns true if the map is empty (contains no elements), false otherwise.

Link copied to clipboard
abstract fun toMap(): MT

Create a new map from this map

Link copied to clipboard
abstract fun toMutableMap(): MMT

Create a mutable map from this map