A map backed by an array. Expects key to be convertible to an integer and be non-negative. If a map is a singleton, it is made an instance of a special class to save space. If a singleton is expanded with new elements added and then those elements are removed, it does not revert to a singleton for performance reasons. Such a behaviour is not necessary for the pattern of behaviour utilised by the learner. In principle, it can be implemented so that when the number of elements drops to the array could be thrown away and reverted to a single pair. Ordinarily, this would have been derived from {@link AbstractMap}, however in the interest of memory use this is not done as it would bring in all the attributes of {@link AbstractMap} that we aim to avoid. Important: this collection does not track modifications, so it will never throw {@link ConcurrentModificationException}but instead may return completely wrong values. This is done to reduce memory footprint when storing tens of millions of entries, some of which could be instances of this class.
@author kirill
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.