Library / Collections / Dictionaries / CollisionNode
CollisionNode
CollisionNode.ev — one (key, value, cachedHash) cell, as a VALUE CLASS so the
hash bucket stores it INLINE (no per-entry heap node). This is the Phase-1 dict-
rebuild substrate replacing the heap-allocated ChainedHashEntry: a HashBucket
holds CollisionNodes by value (two inline slots + a contiguous spill), and an
Array[CollisionNode[K,V]] lowers to inline storage — _ValueArray when K,V are
primitive (the trivially-copyable C-class path), _ObjectArray-by-value when K is
a class (e.g. a String key → owning handle field, the managed value-class form
the compiler deep-copies).
Constructors 2
INIT()An empty node: key and value at their types' defaults, and not valid. What
an array slot holds before a node is written to it (I.J.vi, E1159); .valid
is what says it holds nothing.
INIT(K k, V v, HASH h)Methods 8
METHOD hashValue() RETURNS HASHreads
The cached hash of this node's key (used by resize re-bucketing and the pre-compare reject in lookup).
METHOD matches(HASH h, REFERENCE K other) RETURNS booleanreads
TRUE if this node matches both the query hash and the query key. The cached
HASH is checked first (cheap reject); only on a hash hit is identity confirmed
via Equatable (class keys) or == (primitive keys) — the design doc's "compare
hash first, confirm key" step. Backs every lookup/insert/remove scan.
MODIFY METHOD setValue(V v) RETURNS voidmodifies
Replace the stored value in place — backs insert-over-existing-key (the key and cached hash are unchanged).
METHOD valueClone() RETURNS Vreads
A clone of the stored value — backs by-value lookup.
METHOD keyClone() RETURNS Kreads
A clone of the stored key — backs keys().
METHOD clone() RETURNS CollisionNode[K, V, HASH]reads
Deep copy — key and value cloned, cached hash carried across.
METHOD equals(REFERENCE CollisionNode[K, V, HASH] other) RETURNS booleanreads
METHOD isLessThan(REFERENCE CollisionNode[K, V, HASH] other) RETURNS booleanreads