Several classes provide implementations of the map interfaces.
The classes that can be used for maps are summarized here:
| Class | Description |
|---|---|
| AbstractMap | Implements most of the Map interface. |
| EnumMap | Extends AbstractMap for use with enum keys. |
| HashMap | Extends AbstractMap to use a hash table. |
| TreeMap | Extends AbstractMap to use a tree. |
| WeakHashMap | Extends AbstractMap to use a hash table with weak keys. |
| LinkedHashMap | Extends HashMap to allow insertion-order iterations. |
| IdentityHashMap | Extends AbstractMap and uses reference equality when comparing documents. |
Notice that AbstractMap is a superclass for all concrete map implementations.
WeakHashMap implements a map that uses "weak keys," which allows an element in a map to be garbage-collected when its key is otherwise unused.
PreviousNext