Hashtable

The table behind Map and Set: a hash map for lookup plus a doubly linked list for insertion order.

The linked list is the reason this is not a LinkedHashMap. JavaScript lets a script add to, delete from or clear a collection while an iterator is walking it, and the iterator has to keep going from where it was. A deleted node keeps its next pointer so any iterator sitting on it can still walk forward; only the prev pointers are unlinked, so new iterators never see it.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion
Link copied to clipboard
class Entry

One entry, and at the same time one node of the list. equals and hashCode follow JavaScript's SameValueZero, not Java's rules.

Properties

Link copied to clipboard
val size: Int

Functions

Link copied to clipboard
fun clear()
Link copied to clipboard
fun deleteEntry(key: Any?): Boolean
Link copied to clipboard
Link copied to clipboard
fun has(key: Any?): Boolean
Link copied to clipboard
open operator override fun iterator(): Iterator<Hashtable.Entry>
Link copied to clipboard
fun put(key: Any?, value: Any?)