# AbstractMap

public abstract class **AbstractMap** extends [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)  
implements [Map](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Map.html)\<K, V\>

|---|---|---|
| Known Direct Subclasses [ConcurrentHashMap](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/concurrent/ConcurrentHashMap.html)\<K, V\>, [ConcurrentSkipListMap](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/concurrent/ConcurrentSkipListMap.html)\<K, V\>, [EnumMap](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/EnumMap.html)\<K extends [Enum](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Enum.html)\<K\>, V\>, [HashMap](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/HashMap.html)\<K, V\>, [IdentityHashMap](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/IdentityHashMap.html)\<K, V\>, [TreeMap](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/TreeMap.html)\<K, V\>, [WeakHashMap](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/WeakHashMap.html)\<K, V\> |---|---| | [ConcurrentHashMap](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/concurrent/ConcurrentHashMap.html)\<K, V\> | A hash table supporting full concurrency of retrievals and high expected concurrency for updates. | | [ConcurrentSkipListMap](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/concurrent/ConcurrentSkipListMap.html)\<K, V\> | A scalable concurrent `https://developers.google.com/j2objc/javadoc/jre/reference/java/util/concurrent/ConcurrentNavigableMap.html` implementation. | | [EnumMap](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/EnumMap.html)\<K extends [Enum](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Enum.html)\<K\>, V\> | A specialized `https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Map.html` implementation for use with enum type keys. | | [HashMap](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/HashMap.html)\<K, V\> | Hash table based implementation of the Map interface. | | [IdentityHashMap](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/IdentityHashMap.html)\<K, V\> | This class implements the Map interface with a hash table, using reference-equality in place of object-equality when comparing keys (and values). | | [TreeMap](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/TreeMap.html)\<K, V\> | A Red-Black tree based `https://developers.google.com/j2objc/javadoc/jre/reference/java/util/NavigableMap.html` implementation. | | [WeakHashMap](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/WeakHashMap.html)\<K, V\> | Hash table based implementation of the Map interface, with *weak keys*. | |||

|---|---|---|
| Known Indirect Subclasses [LinkedHashMap](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/LinkedHashMap.html)\<K, V\> |---|---| | [LinkedHashMap](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/LinkedHashMap.html)\<K, V\> | Hash table and linked list implementation of the Map interface, with predictable iteration order. | |||

This class provides a skeletal implementation of the Map
interface, to minimize the effort required to implement this interface.

To implement an unmodifiable map, the programmer needs only to extend this
class and provide an implementation for the entrySet method, which
returns a set-view of the map's mappings. Typically, the returned set
will, in turn, be implemented atop AbstractSet. This set should
not support the add or remove methods, and its iterator
should not support the remove method.

To implement a modifiable map, the programmer must additionally override
this class's put method (which otherwise throws an
UnsupportedOperationException), and the iterator returned by
entrySet().iterator() must additionally implement its
remove method.

The programmer should generally provide a void (no argument) and map
constructor, as per the recommendation in the Map interface
specification.

The documentation for each non-abstract method in this class describes its
implementation in detail. Each of these methods may be overridden if the
map being implemented admits a more efficient implementation.

This class is a member of the
[Java Collections Framework](https://developers.google.com/j2objc/javadoc/jre/technotes/guides/collections/index.html).

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Map.html`
- `https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Collection.html`

### Nested Class Summary

|---|---|---|---|
| class | [AbstractMap.SimpleEntry](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/AbstractMap.SimpleEntry.html)\<K, V\> || An Entry maintaining a key and a value. |
| class | [AbstractMap.SimpleImmutableEntry](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/AbstractMap.SimpleImmutableEntry.html)\<K, V\> || An Entry maintaining an immutable key and value. |

### Protected Constructor Summary

|---|---|
|   | [AbstractMap](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/AbstractMap.html#AbstractMap())() Sole constructor. |

### Public Method Summary

|---|---|
| void | [clear](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/AbstractMap.html#clear())() Removes all of the mappings from this map (optional operation). |
| boolean | [containsKey](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/AbstractMap.html#containsKey(java.lang.Object))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) key) Returns `true` if this map contains a mapping for the specified key. |
| boolean | [containsValue](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/AbstractMap.html#containsValue(java.lang.Object))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) value) Returns `true` if this map maps one or more keys to the specified value. |
| abstract [Set](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Set.html)\<[Entry](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Map.Entry.html)\<K, V\>\> | [entrySet](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/AbstractMap.html#entrySet())() Returns a `https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Set.html` view of the mappings contained in this map. |
| boolean | [equals](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/AbstractMap.html#equals(java.lang.Object))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) o) Compares the specified object with this map for equality. |
| V | [get](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/AbstractMap.html#get(java.lang.Object))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) key) Returns the value to which the specified key is mapped, or `null` if this map contains no mapping for the key. |
| int | [hashCode](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/AbstractMap.html#hashCode())() Returns the hash code value for this map. |
| boolean | [isEmpty](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/AbstractMap.html#isEmpty())() Returns `true` if this map contains no key-value mappings. |
| [Set](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Set.html)\<K\> | [keySet](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/AbstractMap.html#keySet())() Returns a `https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Set.html` view of the keys contained in this map. |
| V | [put](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/AbstractMap.html#put(K,%20V))(K key, V value) Associates the specified value with the specified key in this map (optional operation). |
| void | [putAll](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/AbstractMap.html#putAll(java.util.Map<?%20extends%20K,%20?%20extends%20V>))([Map](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Map.html)\<? extends K, ? extends V\> m) Copies all of the mappings from the specified map to this map (optional operation). |
| V | [remove](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/AbstractMap.html#remove(java.lang.Object))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) key) Removes the mapping for a key from this map if it is present (optional operation). |
| int | [size](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/AbstractMap.html#size())() Returns the number of key-value mappings in this map. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [toString](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/AbstractMap.html#toString())() Returns a string representation of this map. |
| [Collection](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Collection.html)\<V\> | [values](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/AbstractMap.html#values())() Returns a `https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Collection.html` view of the values contained in this map. |

### Protected Method Summary

|---|---|
| [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) | [clone](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/AbstractMap.html#clone())() Returns a shallow copy of this AbstractMap instance: the keys and values themselves are not cloned. |

### Inherited Method Summary

From class [java.lang.Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)

|---|---|
| [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) | [clone](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#clone())() Creates and returns a copy of this `Object`. |
| boolean | [equals](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#equals(java.lang.Object))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) obj) Compares this instance with the specified object and indicates if they are equal. |
| void | [finalize](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#finalize())() Invoked when the garbage collector has detected that this instance is no longer reachable. |
| final [Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<?\> | [getClass](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#getClass())() Returns the unique instance of `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html` that represents this object's class. |
| int | [hashCode](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#hashCode())() Returns an integer hash code for this object. |
| final void | [notify](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notify())() Causes a thread which is waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| final void | [notifyAll](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notifyAll())() Causes all threads which are waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [toString](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#toString())() Returns a string containing a concise, human-readable description of this object. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long,%20int))(long timeout, int nanos) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long))(long timeout) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait())() Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object. |

From interface [java.util.Map](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Map.html)

|---|---|
| abstract void | [clear](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Map.html#clear())() Removes all of the mappings from this map (optional operation). |
| V | [compute](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Map.html#compute(K,%20java.util.function.BiFunction<?%20super%20K,%20?%20super%20V,%20?%20extends%20V>))(K key, [BiFunction](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/function/BiFunction.html)\<? super K, ? super V, ? extends V\> remappingFunction) Attempts to compute a mapping for the specified key and its current mapped value (or `null` if there is no current mapping). |
| V | [computeIfAbsent](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Map.html#computeIfAbsent(K,%20java.util.function.Function<?%20super%20K,%20?%20extends%20V>))(K key, [Function](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/function/Function.html)\<? super K, ? extends V\> mappingFunction) If the specified key is not already associated with a value (or is mapped to `null`), attempts to compute its value using the given mapping function and enters it into this map unless `null`. |
| V | [computeIfPresent](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Map.html#computeIfPresent(K,%20java.util.function.BiFunction<?%20super%20K,%20?%20super%20V,%20?%20extends%20V>))(K key, [BiFunction](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/function/BiFunction.html)\<? super K, ? super V, ? extends V\> remappingFunction) If the value for the specified key is present and non-null, attempts to compute a new mapping given the key and its current mapped value. |
| abstract boolean | [containsKey](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Map.html#containsKey(java.lang.Object))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) key) Returns `true` if this map contains a mapping for the specified key. |
| abstract boolean | [containsValue](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Map.html#containsValue(java.lang.Object))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) value) Returns `true` if this map maps one or more keys to the specified value. |
| abstract [Set](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Set.html)\<[Entry](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Map.Entry.html)\<K, V\>\> | [entrySet](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Map.html#entrySet())() Returns a `https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Set.html` view of the mappings contained in this map. |
| abstract boolean | [equals](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Map.html#equals(java.lang.Object))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) o) Compares the specified object with this map for equality. |
| void | [forEach](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Map.html#forEach(java.util.function.BiConsumer<?%20super%20K,%20?%20super%20V>))([BiConsumer](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/function/BiConsumer.html)\<? super K, ? super V\> action) Performs the given action for each entry in this map until all entries have been processed or the action throws an exception. |
| abstract V | [get](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Map.html#get(java.lang.Object))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) key) Returns the value to which the specified key is mapped, or `null` if this map contains no mapping for the key. |
| V | [getOrDefault](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Map.html#getOrDefault(java.lang.Object,%20V))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) key, V defaultValue) Returns the value to which the specified key is mapped, or `defaultValue` if this map contains no mapping for the key. |
| abstract int | [hashCode](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Map.html#hashCode())() Returns the hash code value for this map. |
| abstract boolean | [isEmpty](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Map.html#isEmpty())() Returns `true` if this map contains no key-value mappings. |
| abstract [Set](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Set.html)\<K\> | [keySet](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Map.html#keySet())() Returns a `https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Set.html` view of the keys contained in this map. |
| V | [merge](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Map.html#merge(K,%20V,%20java.util.function.BiFunction<?%20super%20V,%20?%20super%20V,%20?%20extends%20V>))(K key, V value, [BiFunction](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/function/BiFunction.html)\<? super V, ? super V, ? extends V\> remappingFunction) If the specified key is not already associated with a value or is associated with null, associates it with the given non-null value. |
| abstract V | [put](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Map.html#put(K,%20V))(K key, V value) Associates the specified value with the specified key in this map (optional operation). |
| abstract void | [putAll](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Map.html#putAll(java.util.Map<?%20extends%20K,%20?%20extends%20V>))([Map](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Map.html)\<? extends K, ? extends V\> m) Copies all of the mappings from the specified map to this map (optional operation). |
| V | [putIfAbsent](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Map.html#putIfAbsent(K,%20V))(K key, V value) If the specified key is not already associated with a value (or is mapped to `null`) associates it with the given value and returns `null`, else returns the current value. |
| boolean | [remove](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Map.html#remove(java.lang.Object,%20java.lang.Object))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) key, [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) value) Removes the entry for the specified key only if it is currently mapped to the specified value. |
| abstract V | [remove](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Map.html#remove(java.lang.Object))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) key) Removes the mapping for a key from this map if it is present (optional operation). |
| boolean | [replace](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Map.html#replace(K,%20V,%20V))(K key, V oldValue, V newValue) Replaces the entry for the specified key only if currently mapped to the specified value. |
| V | [replace](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Map.html#replace(K,%20V))(K key, V value) Replaces the entry for the specified key only if it is currently mapped to some value. |
| void | [replaceAll](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Map.html#replaceAll(java.util.function.BiFunction<?%20super%20K,%20?%20super%20V,%20?%20extends%20V>))([BiFunction](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/function/BiFunction.html)\<? super K, ? super V, ? extends V\> function) Replaces each entry's value with the result of invoking the given function on that entry until all entries have been processed or the function throws an exception. |
| abstract int | [size](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Map.html#size())() Returns the number of key-value mappings in this map. |
| abstract [Collection](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Collection.html)\<V\> | [values](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Map.html#values())() Returns a `https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Collection.html` view of the values contained in this map. |

## Protected Constructors

#### protected
**AbstractMap**
()

Sole constructor. (For invocation by subclass constructors, typically
implicit.)

## Public Methods

#### public void
**clear**
()

Removes all of the mappings from this map (optional operation).
The map will be empty after this call returns.

##### Throws

| [UnsupportedOperationException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/UnsupportedOperationException.html) |   |
|---|---|

#### public boolean
**containsKey**
([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) key)

Returns `true` if this map contains a mapping for the specified
key. More formally, returns `true` if and only if
this map contains a mapping for a key `k` such that
`Objects.equals(key, k)`. (There can be
at most one such mapping.)

##### Parameters

| key | key whose presence in this map is to be tested |
|---|---|

##### Returns

- `true` if this map contains a mapping for the specified key

##### Throws

| [ClassCastException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassCastException.html) |   |
| [NullPointerException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) |   |
|---|---|

#### public boolean
**containsValue**
([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) value)

Returns `true` if this map maps one or more keys to the
specified value. More formally, returns `true` if and only if
this map contains at least one mapping to a value `v` such that
`Objects.equals(value, v)`. This operation
will probably require time linear in the map size for most
implementations of the `Map` interface.

##### Parameters

| value | value whose presence in this map is to be tested |
|---|---|

##### Returns

- `true` if this map maps one or more keys to the specified value

##### Throws

| [ClassCastException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassCastException.html) |   |
| [NullPointerException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) |   |
|---|---|

#### public abstract [Set](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Set.html)\<[Entry](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Map.Entry.html)\<K, V\>\>
**entrySet**
()

Returns a `https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Set.html` view of the mappings contained in this map.
The set is backed by the map, so changes to the map are
reflected in the set, and vice-versa. If the map is modified
while an iteration over the set is in progress (except through
the iterator's own `remove` operation, or through the
`setValue` operation on a map entry returned by the
iterator) the results of the iteration are undefined. The set
supports element removal, which removes the corresponding
mapping from the map, via the `Iterator.remove`,
`Set.remove`, `removeAll`, `retainAll` and
`clear` operations. It does not support the
`add` or `addAll` operations.

##### Returns

- a set view of the mappings contained in this map

#### public boolean
**equals**
([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) o)

Compares the specified object with this map for equality. Returns
true if the given object is also a map and the two maps
represent the same mappings. More formally, two maps m1 and
m2 represent the same mappings if
m1.entrySet().equals(m2.entrySet()). This ensures that the
equals method works properly across different implementations
of the Map interface.

##### Parameters

| o | object to be compared for equality with this map |
|---|---|

##### Returns

- true if the specified object is equal to this map

#### public V
**get**
([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) key)

Returns the value to which the specified key is mapped,
or `null` if this map contains no mapping for the key.

More formally, if this map contains a mapping from a key
`k` to a value `v` such that
`Objects.equals(key, k)`,
then this method returns `v`; otherwise
it returns `null`. (There can be at most one such mapping.)

If this map permits null values, then a return value of
`null` does not *necessarily* indicate that the map
contains no mapping for the key; it's also possible that the map
explicitly maps the key to `null`. The `https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Map.html#containsKey(java.lang.Object)` operation may be used to distinguish these two cases.

##### Parameters

| key | the key whose associated value is to be returned |
|---|---|

##### Returns

- the value to which the specified key is mapped, or `null` if this map contains no mapping for the key

##### Throws

| [ClassCastException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassCastException.html) |   |
| [NullPointerException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) |   |
|---|---|

#### public int
**hashCode**
()

Returns the hash code value for this map. The hash code of a map is
defined to be the sum of the hash codes of each entry in the map's
entrySet() view. This ensures that m1.equals(m2)
implies that m1.hashCode()==m2.hashCode() for any two maps
m1 and m2, as required by the general contract of
`https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#hashCode()`.

##### Returns

- the hash code value for this map

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Map.Entry.html#hashCode()`
- `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#equals(java.lang.Object)`
- `https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Set.html#equals(java.lang.Object)`

#### public boolean
**isEmpty**
()

Returns `true` if this map contains no key-value mappings.

##### Returns

- `true` if this map contains no key-value mappings

#### public [Set](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Set.html)\<K\>
**keySet**
()

Returns a `https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Set.html` view of the keys contained in this map.
The set is backed by the map, so changes to the map are
reflected in the set, and vice-versa. If the map is modified
while an iteration over the set is in progress (except through
the iterator's own `remove` operation), the results of
the iteration are undefined. The set supports element removal,
which removes the corresponding mapping from the map, via the
`Iterator.remove`, `Set.remove`,
`removeAll`, `retainAll`, and `clear`
operations. It does not support the `add` or `addAll`
operations.

##### Returns

- a set view of the keys contained in this map

#### public V
**put**
(K key, V value)

Associates the specified value with the specified key in this map
(optional operation). If the map previously contained a mapping for
the key, the old value is replaced by the specified value. (A map
`m` is said to contain a mapping for a key `k` if and only
if `https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Map.html#containsKey(java.lang.Object)` would return
`true`.)

##### Parameters

| key | key with which the specified value is to be associated |
| value | value to be associated with the specified key |
|---|---|

##### Returns

- the previous value associated with `key`, or `null` if there was no mapping for `key`. (A `null` return can also indicate that the map previously associated `null` with `key`, if the implementation supports `null` values.)

##### Throws

| [UnsupportedOperationException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/UnsupportedOperationException.html) |   |
| [ClassCastException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassCastException.html) |   |
| [NullPointerException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) |   |
| [IllegalArgumentException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalArgumentException.html) |   |
|---|---|

#### public void
**putAll**
([Map](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Map.html)\<? extends K, ? extends V\> m)

Copies all of the mappings from the specified map to this map
(optional operation). The effect of this call is equivalent to that
of calling `https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Map.html#put(K,%20V)` on this map once
for each mapping from key `k` to value `v` in the
specified map. The behavior of this operation is undefined if the
specified map is modified while the operation is in progress.

##### Parameters

| m | mappings to be stored in this map |
|---|---|

##### Throws

| [UnsupportedOperationException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/UnsupportedOperationException.html) |   |
| [ClassCastException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassCastException.html) |   |
| [NullPointerException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) |   |
| [IllegalArgumentException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalArgumentException.html) |   |
|---|---|

#### public V
**remove**
([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) key)

Removes the mapping for a key from this map if it is present
(optional operation). More formally, if this map contains a mapping
from key `k` to value `v` such that
`Objects.equals(key, k)`, that mapping
is removed. (The map can contain at most one such mapping.)

Returns the value to which this map previously associated the key,
or `null` if the map contained no mapping for the key.

If this map permits null values, then a return value of
`null` does not *necessarily* indicate that the map
contained no mapping for the key; it's also possible that the map
explicitly mapped the key to `null`.

The map will not contain a mapping for the specified key once the
call returns.

##### Parameters

| key | key whose mapping is to be removed from the map |
|---|---|

##### Returns

- the previous value associated with `key`, or `null` if there was no mapping for `key`.

##### Throws

| [UnsupportedOperationException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/UnsupportedOperationException.html) |   |
| [ClassCastException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassCastException.html) |   |
| [NullPointerException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) |   |
|---|---|

#### public int
**size**
()

Returns the number of key-value mappings in this map. If the
map contains more than `Integer.MAX_VALUE` elements, returns
`Integer.MAX_VALUE`.

##### Returns

- the number of key-value mappings in this map

#### public [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html)
**toString**
()

Returns a string representation of this map. The string representation
consists of a list of key-value mappings in the order returned by the
map's entrySet view's iterator, enclosed in braces
("{}"). Adjacent mappings are separated by the characters
", " (comma and space). Each key-value mapping is rendered as
the key followed by an equals sign ("=") followed by the
associated value. Keys and values are converted to strings as by
`https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html#valueOf(java.lang.Object)`.

##### Returns

- a string representation of this map

#### public [Collection](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Collection.html)\<V\>
**values**
()

Returns a `https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Collection.html` view of the values contained in this map.
The collection is backed by the map, so changes to the map are
reflected in the collection, and vice-versa. If the map is
modified while an iteration over the collection is in progress
(except through the iterator's own `remove` operation),
the results of the iteration are undefined. The collection
supports element removal, which removes the corresponding
mapping from the map, via the `Iterator.remove`,
`Collection.remove`, `removeAll`,
`retainAll` and `clear` operations. It does not
support the `add` or `addAll` operations.

##### Returns

- a collection view of the values contained in this map

## Protected Methods

#### protected [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)
**clone**
()

Returns a shallow copy of this AbstractMap instance: the keys
and values themselves are not cloned.

##### Returns

- a shallow copy of this map

##### Throws

| [CloneNotSupportedException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/CloneNotSupportedException.html) |   |
|---|---|