HashMap
public
class
HashMap
extends AbstractMap<K, V>
implements
Cloneable,
Map<K, V>,
Serializable
| java.lang.Object | ||
| ↳ | java.util.AbstractMap<K, V> | |
| ↳ | java.util.HashMap<K, V> | |
Hash table based implementation of the Map interface. This
implementation provides all of the optional map operations, and permits
null values and the null key. (The HashMap
class is roughly equivalent to Hashtable, except that it is
unsynchronized and permits nulls.) This class makes no guarantees as to
the order of the map; in particular, it does not guarantee that the order
will remain constant over time.
This implementation provides constant-time performance for the basic
operations (get and put), assuming the hash function
disperses the elements properly among the buckets. Iteration over
collection views requires time proportional to the "capacity" of the
HashMap instance (the number of buckets) plus its size (the number
of key-value mappings). Thus, it's very important not to s