TreeMap

A MutableSortedMap implementation backed by a Red/Black Tree, with each map entry being represented as a node. Search, insertion, and removal all run in O(log n) time thanks to the properties of the tree.

The keys and entries use a specialized implementation which shares the tree used by the map. This allows operations on the returned sets to be reflected on the map without any additional performance costs. Note that neither keys nor entries support adding new values, following the convention set by key sets in JVM maps.

Removing map entries while iterating is not allowed, and using MutableIterator.remove will throw an exception.

Constructors

Link copied to clipboard
constructor()

Properties

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

Functions

Link copied to clipboard
open override fun clear()
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 get(key: K): V?
Link copied to clipboard
open override fun isEmpty(): Boolean
Link copied to clipboard
open override fun put(key: K, value: V): V?
Link copied to clipboard
open override fun putAll(from: Map<out K, V>)
Link copied to clipboard
open override fun remove(key: K): V?