ArrayMap

class ArrayMap<K : Comparable<K>, V : Any>(data: Array<Any>) : Map<K, V>

An immutable, sorted, array-backed map - if keys are String, they have a special sort order where / is the lowest key.

Constructors

Link copied to clipboard
constructor(data: Array<Any>)

Types

Link copied to clipboard
object Companion

Properties

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

list-backed set of entries.

Link copied to clipboard
open override val keys: ListBackedSet<K>
Link copied to clipboard
open override val size: Int
Link copied to clipboard
open override val values: List<V>

list-backed collection of values at odd indices.

Functions

Link copied to clipboard
open override fun containsKey(key: K): Boolean
Link copied to clipboard
open override fun containsValue(value: V): Boolean
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open operator override fun get(key: K): V?
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun isEmpty(): Boolean
Link copied to clipboard
fun minusSortedIndices(indicesToRemove: List<Int>): ArrayMap<K, V>
Link copied to clipboard
fun plus(key: K, value: V): ArrayMap<K, V>

Returns a new ArrayMap which has added the given key. Throws an exception if the key already exists.

Link copied to clipboard
fun plusOrNoOp(key: K, value: V): ArrayMap<K, V>

Returns a new ArrayMap which has added the given key, or the current map if the key was already in the map.

Link copied to clipboard
fun plusOrNoOpOrReplace(key: K, newValue: V): ArrayMap<K, V>

Returns an ArrayMap which has added or overwritten the given key/value. If the map already contained that mapping (equal keys and values) then it returns the identically same map.

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