PriorityMap

class PriorityMap<K : Comparable<K>?, V>

A map that maintains the order of values based on priority, insertion order, and key comparison.

Since

3.0.0

Parameters

<K>

the type of keys maintained by this map

<V>

the type of mapped values

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
@Nullable
open fun get(@NotNull key: @NotNull K): @Nullable V
Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.
Link copied to clipboard
open fun isEmpty(): Boolean
Returns true if this map contains no key-value mappings.
Link copied to clipboard
@Nullable
open fun put(@NotNull key: @NotNull K, @NotNull value: @NotNull V, priority: Int): @Nullable V
Associates the specified value with the specified key and priority in this map.
Link copied to clipboard
@Nullable
open fun remove(@NotNull key: @NotNull K): @Nullable V
Removes the mapping for a key from this map if it is present.
Link copied to clipboard
@Nullable
open fun replace(@NotNull Key: @NotNull K, @NotNull function: @NotNull (V) -> V): @Nullable V
Replaces the entry for the specified key only if it is currently mapped to some value.
Link copied to clipboard
@NotNull
open fun valueIterator(): @NotNull Iterator<V>
Returns an iterator over the values in this map in priority order.