K
- the type of the keys in the mapV
- the type of the values in the mappublic abstract class AbstractMapDecorator<K,V> extends AbstractIterableMap<K,V>
Methods are forwarded directly to the decorated map.
This implementation does not perform any special processing with
entrySet()
, keySet()
or values()
. Instead
it simply returns the set/collection from the wrapped map. This may be
undesirable, for example if you are trying to write a validating
implementation it would provide a loophole around the validation.
But, you might want that loophole, so this class is kept simple.
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
containsKey(java.lang.Object key) |
boolean |
containsValue(java.lang.Object value) |
java.util.Set<java.util.Map.Entry<K,V>> |
entrySet() |
boolean |
equals(java.lang.Object object) |
V |
get(java.lang.Object key) |
int |
hashCode() |
boolean |
isEmpty() |
java.util.Set<K> |
keySet() |
V |
put(K key,
V value)
Note that the return type is Object, rather than V as in the Map interface.
|
void |
putAll(java.util.Map<? extends K,? extends V> mapToCopy) |
V |
remove(java.lang.Object key) |
int |
size() |
java.lang.String |
toString() |
java.util.Collection<V> |
values() |
mapIterator
public void clear()
Map.clear()
public boolean containsKey(java.lang.Object key)
key
- key whose presence in this map is to be testedtrue
if this map contains a mapping for the specified
keyMap.containsKey(Object)
public boolean containsValue(java.lang.Object value)
value
- value whose presence in this map is to be testedtrue
if this map maps one or more keys to the
specified valueMap.containsValue(Object)
public java.util.Set<java.util.Map.Entry<K,V>> entrySet()
Map.entrySet()
public V get(java.lang.Object key)
key
- the key whose associated value is to be returnednull
if this map contains no mapping for the keyMap.get(Object)
public boolean isEmpty()
true
if this map contains no key-value mappingsMap.isEmpty()
public java.util.Set<K> keySet()
Map.keySet()
public V put(K key, V value)
Put
key
- key with which the specified value is to be associatedvalue
- value to be associated with the specified keykey
, 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.)Map.put(Object, Object)
public void putAll(java.util.Map<? extends K,? extends V> mapToCopy)
mapToCopy
- mappings to be stored in this mapMap.putAll(Map)
public V remove(java.lang.Object key)
key
- key whose mapping is to be removed from the mapkey
, or
null
if there was no mapping for key
.Map.remove(Object)
public int size()
Map.size()
public java.util.Collection<V> values()
Map.values()
public boolean equals(java.lang.Object object)
public int hashCode()
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2010 - 2023 Adobe. All Rights Reserved