IntObjectMap

internal class IntObjectMap<V>

A highly optimized, primitive-key map implementation that maps primitive Int keys to object values.

This implementation avoids the memory and performance overhead of autoboxing integers into java.lang.Integer objects, which occurs when using standard collections like HashMap<Int, V>. It utilizes open addressing with linear probing for fast lookups and insertions.

Note: The key 0 is reserved internally as an empty slot indicator and cannot be used.

Type Parameters

V

the type of values maintained by this map

Constructors

Link copied to clipboard
constructor(capacity: Int = 128)
constructor(other: IntObjectMap<V>)

Properties

Link copied to clipboard
Link copied to clipboard
val size: Int
Link copied to clipboard
val values: List<V>

Functions

Link copied to clipboard
Link copied to clipboard
fun forEach(action: (key: Int, value: V) -> Unit)
Link copied to clipboard
operator fun get(key: Int): V?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun put(key: Int, value: V)
Link copied to clipboard
operator fun set(key: Int, value: V)