Class UnifiedMapWithHashingStrategy<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 UnifiedMapWithHashingStrategy<K,V> extends AbstractMutableMap<K,V> implements Externalizable, BatchIterable<V>
UnifiedMapWithHashingStrategy 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 difference between UnifiedMap and UnifiedMapWithHashingStrategy is that a HashingStrategy based UnifiedMap does not rely on the hashCode or equality of the object at the key, but instead relies on a HashingStrategy implementation provided by a developer to compute the hashCode and equals for the objects stored in the map.

See Also: