K - The type of keys maintained by this ArrayMap
V - The type of mapped values
All Implemented Interfaces:
An ArrayMap is a Map implemented as a resizable array, just like that of an
ArrayList. An ArrayMap takes up less memory than other Map types, and offers
at-least-comparable performance to a HashMap when the Map size is very small.
For best results, the initial capacity of an ArrayMap should be set to the
smallest number that the ArrayMap's size will almost certainly never exceed.
Constructor and Description
Constructs an empty ArrayMap with an initial capacity of 10.
(int initialCapacity) ArrayMap
Constructs an empty ArrayMap with the specified initial capacity.
(java.util.Map<? extends ArrayMap K,? extends V> m)
Constructs an ArrayMap with the same mappings as the specified Map.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
public ArrayMap(java.util.Map<? extends
K,? extends V> m)
Constructs an ArrayMap with the same mappings as the specified Map. The
ArrayMap is created with enough initial capacity to hold these mappings.
m - The Map whose mappings are to be placed into this ArrayMap
public int size()
size in interface
public boolean isEmpty()
isEmpty in interface
public void clear()
clear in interface
public final void trimToSize()
Trims the capacity of this ArrayMap to be equal to its current size. This
operation runs in time proportional to the ArrayMap's size, but it
minimizes the amount of memory taken up by the ArrayMap.
public final void ensureCapacity(int minCapacity)
Increases the capacity of this ArrayMap, if necessary, to be at least the
specified minimum capacity.
minCapacity - The minimum capacity that this ArrayMap should have