Class ForwardingMap<K,V>
- java.lang.Object
 - 
- com.google.common.collect.ForwardingObject
 - 
- com.google.common.collect.ForwardingMap<K,V>
 
 
 
- 
- All Implemented Interfaces:
 java.util.Map<K,V>
- Direct Known Subclasses:
 EnumBiMap,EnumHashBiMap,ForwardingConcurrentMap,ForwardingSortedMap,ImmutableClassToInstanceMap,ImmutableTypeToInstanceMap,MutableClassToInstanceMap,MutableTypeToInstanceMap
@GwtCompatible public abstract class ForwardingMap<K,V> extends ForwardingObject implements java.util.Map<K,V>
A map which forwards all its method calls to another map. Subclasses should override one or more methods to modify the behavior of the backing map as desired per the decorator pattern.Warning: The methods of
ForwardingMapforward indiscriminately to the methods of the delegate. For example, overridingput(K, V)alone will not change the behavior ofputAll(java.util.Map<? extends K, ? extends V>), which can lead to unexpected behavior. In this case, you should overrideputAllas well, either providing your own implementation, or delegating to the providedstandardPutAllmethod.Each of the
standardmethods, where appropriate, useObjects.equal(java.lang.Object, java.lang.Object)to test equality for both keys and values. This may not be the desired behavior for map implementations that use non-standard notions of key equality, such as aSortedMapwhose comparator is not consistent withequals.The
standardmethods and the collection views they return are not guaranteed to be thread-safe, even when all of the methods that they depend on are thread-safe.- Since:
 - 2.0 (imported from Google Collections Library)
 
 
- 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()booleancontainsKey(java.lang.Object key)booleancontainsValue(java.lang.Object value)java.util.Set<java.util.Map.Entry<K,V>>entrySet()booleanequals(java.lang.Object object)Vget(java.lang.Object key)inthashCode()booleanisEmpty()java.util.Set<K>keySet()Vput(K key, V value)voidputAll(java.util.Map<? extends K,? extends V> map)Vremove(java.lang.Object object)intsize()java.util.Collection<V>values()- 
Methods inherited from class com.google.common.collect.ForwardingObject
toString 
 - 
 
 - 
 
- 
- 
Method Detail
- 
remove
public V remove(java.lang.Object object)
 
- 
containsKey
public boolean containsKey(@Nullable java.lang.Object key) 
- 
containsValue
public boolean containsValue(@Nullable java.lang.Object value) 
- 
get
public V get(@Nullable java.lang.Object key)
 
- 
values
public java.util.Collection<V> values()
 
- 
equals
public boolean equals(@Nullable java.lang.Object object) 
 - 
 
 -