| java.lang.Object | |
| ↳ | java.util.AbstractMap<K, V> |
Known Direct Subclasses
ConcurrentHashMap<K, V>,
EnumMap<K extends Enum<K>, V>,
HashMap<K, V>,
IdentityHashMap<K, V>,
TreeMap<K, V>,
WeakHashMap<K, V>
|
Known Indirect Subclasses
LinkedHashMap<K, V>
|
AbstractMap is an abstract implementation of the Map interface. This Implementation does not support adding. A subclass must implement the abstract method entrySet().
| Protected Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a new instance of this AbstractMap.
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Removes all elements from this Map, leaving it empty.
| |||||||||||
Searches this Map for the specified key.
| |||||||||||
Searches this Map for the specified value.
| |||||||||||
Returns a set view of the mappings contained in this map.
| |||||||||||
Compares the specified object to this Map and answer if they are equal.
| |||||||||||
Returns the value of the mapping with the specified key.
| |||||||||||
Returns an integer hash code for the receiver.
| |||||||||||
Returns if this Map has no elements, a size of zero.
| |||||||||||
Returns a Set of the keys contained in this Map.
| |||||||||||
Maps the specified key to the specified value.
| |||||||||||
Copies every mapping in the specified Map to this Map.
| |||||||||||
Removes a mapping with the specified key from this Map.
| |||||||||||
Returns the number of elements in this Map.
| |||||||||||
Returns the string representation of this Map.
| |||||||||||
Returns a collection of the values contained in this map.
| |||||||||||
| Protected Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Returns a new instance of the same class as the receiver, whose slots
have been filled in with the values in the slots of the receiver.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class java.lang.Object
| |||||||||||
From interface java.util.Map
| |||||||||||
Constructs a new instance of this AbstractMap.
Removes all elements from this Map, leaving it empty.
| UnsupportedOperationException | when removing from this Map is not supported |
|---|
Searches this Map for the specified key.
| key | the object to search for |
|---|
key is a key of this Map, false otherwise
Searches this Map for the specified value.
| value | the object to search for |
|---|
value is a value of this Map, false
otherwise
Returns a set view of the mappings contained in this map. Each element in this set is a Map.Entry. The set is backed by the map so changes to one are reflected by the other. (If the map is modified while an iteration over the set is in progress, the results of the iteration are undefined.) The set supports remove, removeAll, retainAll and clear operations, and it does not support add or addAll operations.
Compares the specified object to this Map and answer if they are equal. The object must be an instance of Map and contain the same key/value pairs.
| object | the object to compare with this object |
|---|
Returns the value of the mapping with the specified key.
| key | the key |
|---|
Returns an integer hash code for the receiver. Objects which are equal answer the same value for this method.
Returns if this Map has no elements, a size of zero.
Returns a Set of the keys contained in this Map. The set is backed by this Map so changes to one are reflected by the other. The set does not support adding.
Maps the specified key to the specified value.
| key | the key |
|---|---|
| value | the value |
| UnsupportedOperationException | when adding to this Map is not supported |
|---|---|
| ClassCastException | when the class of the key or value is inappropriate for this Map |
| IllegalArgumentException | when the key or value cannot be added to this Map |
| NullPointerException | when the key or value is null and this Map does not support null keys or values |
Copies every mapping in the specified Map to this Map.
| map | the Map to copy mappings from |
|---|
| UnsupportedOperationException | when adding to this Map is not supported |
|---|---|
| ClassCastException | when the class of a key or value is inappropriate for this Map |
| IllegalArgumentException | when a key or value cannot be added to this Map |
| NullPointerException | when a key or value is null and this Map does not support null keys or values |
Removes a mapping with the specified key from this Map.
| key | the key of the mapping to remove |
|---|
| UnsupportedOperationException | when removing from this Map is not supported |
|---|
Returns the number of elements in this Map.
Returns the string representation of this Map.
Returns a collection of the values contained in this map. The collection is backed by this map so changes to one are reflected by the other. The collection supports remove, removeAll, retainAll and clear operations, and it does not support add or addAll operations. This method returns a collection which is the subclass of AbstractCollection. The iterator method of this subclass returns a "wrapper object" over the iterator of map's entrySet(). The size method wraps the map's size method and the contains method wraps the map's containsValue method. The collection is created when this method is called at first time and returned in response to all subsequent calls. This method may return different Collection when multiple calls to this method, since it has no synchronization performed.
Returns a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.
| CloneNotSupportedException | if the receiver's class does not implement the interface Cloneable. |
|---|