public interface Object2ObjectMap<K,V> extends Object2ObjectFunction<K,V>, Map<K,V>
Map; provides some additional methods that use polymorphism to avoid (un)boxing, and handling of a default return value.
Besides extending the corresponding type-specific function, this interface strengthens entrySet(),
keySet() and values(). Maps returning entry sets of type Object2ObjectMap.FastEntrySet support also fast iteration.
A submap or subset may or may not have an independent default return value (which however must be initialized to the default return value of the originator).
Map| Modifier and Type | Interface and Description |
|---|---|
static interface |
Object2ObjectMap.Entry<K,V>
A type-specific
Map.Entry; provides some additional methods
that use polymorphism to avoid (un)boxing. |
static interface |
Object2ObjectMap.FastEntrySet<K,V>
An entry set providing fast iteration.
|
| Modifier and Type | Method and Description |
|---|---|
ObjectSet<Map.Entry<K,V>> |
entrySet()
Returns a set view of the mappings contained in this map.
|
ObjectSet<K> |
keySet()
Returns a set view of the keys contained in this map.
|
ObjectSet<Object2ObjectMap.Entry<K,V>> |
object2ObjectEntrySet()
Returns a type-specific set view of the mappings contained in this map.
|
ObjectCollection<V> |
values()
Returns a set view of the values contained in this map.
|
defaultReturnValue, defaultReturnValueObjectSet<Map.Entry<K,V>> entrySet()
Note that this specification strengthens the one given in Map.entrySet().
entrySet in interface Map<K,V>Map.entrySet()ObjectSet<Object2ObjectMap.Entry<K,V>> object2ObjectEntrySet()
This method is necessary because there is no inheritance along
type parameters: it is thus impossible to strengthen entrySet()
so that it returns an ObjectSet
of objects of type Map.Entry (the latter makes it possible to
access keys and values with type-specific methods).
entrySet()ObjectSet<K> keySet()
Note that this specification strengthens the one given in Map.keySet().
keySet in interface Map<K,V>Map.keySet()ObjectCollection<V> values()
Note that this specification strengthens the one given in Map.values().
values in interface Map<K,V>Map.values()