Class UnifiedMap<K,​V>

All Implemented Interfaces:
Externalizable, Serializable, Cloneable, Iterable<V>, Map<K,​V>, InternalIterable<V>, MapIterable<K,​V>, MutableMap<K,​V>, MutableMapIterable<K,​V>, UnsortedMapIterable<K,​V>, RichIterable<V>, BatchIterable<V>

public class UnifiedMap<K,​V>
extends AbstractMutableMap<K,​V>
implements Externalizable, BatchIterable<V>
UnifiedMap stores key/value pairs in a single array, where alternate slots are keys and values. This is nicer to CPU caches as consecutive memory addresses are very cheap to access. Entry objects are not stored in the table like in java.util.HashMap. Instead of trying to deal with collisions in the main array using Entry objects, we put a special object in the key slot and put a regular Object[] in the value slot. The array contains the key value pairs in consecutive slots, just like the main array, but it's a linear list with no hashing.

The final result is a Map implementation that's leaner than java.util.HashMap and faster than Trove's THashMap. The best of both approaches unified together, and thus the name UnifiedMap.

See Also:
Serialized Form