public class CompactMap<K,V>
Map implementation that allows to define the class that implements
The present implementation does not allow null to be used
as a key in the map. The client may use NULL_KEY masking on its own side
if it wants to use null keys (see java.util.HashMap impl).
The load factor is fixed to 1.0 but if the approximate map size
is known there is a constructor that allows to pass the initial capacity.
There are no additional attempts to generally improve hashing for poor hashing functions
like those in HashMap.hash().
The iterators produced by this map are not fail-fast - they will continue iteration
and their behavior is generally undefined after the modification.
The caller should ensure that there will be no pending iterators during modification
of this map.
When iterating through entries in a bucket the Object.equals()
is used for comparison.
Get an entry from a bucket that corresponds to the given hash code.
This may be useful if the hash code can be computed without creating
an actual object being stored in the map. The target object should
provide some method for comparing itself to the passed arguments that represent
the contained data.
hashCode - computed hash code.
first entry in the particular bucket or null if there are no entries
for the given hash code. The caller may need to iterate through the linked
list of the entries to find the right entry.
Put the given entry into the map.
The given entry should only be added to one compact map instance.
Adding a single entry into multiple compact maps will break
internal consistency of all the intended maps!
If there will be an existing entry with a key that equals to the key
in the entry parameter then the original entry will be replaced
by the given entry.