|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectutil.DummyMap<K,V>
K
- the type of keys maintained by this mapV
- the type of mapped valuespublic class DummyMap<K,V>
The DummyMap can be used to remove the space consuming behavior
and retain the checking behavior of a map.
It will accept all mappings from Type K to Type V but will never store anything.
Every return value is fixed to a default value:
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface java.util.Map |
---|
java.util.Map.Entry<K,V> |
Constructor Summary | |
---|---|
DummyMap()
Creates a new instance of DummyMap |
Method Summary | |
---|---|
void |
clear()
This method does nothing. |
boolean |
containsKey(java.lang.Object key)
This Method does not check anything but will return false for each Object key. |
boolean |
containsValue(java.lang.Object value)
This Method does not check anything but will return false for each Object value. |
java.util.Set<java.util.Map.Entry<K,V>> |
entrySet()
This method will return an empty set (in fact an instance of DummySet). |
V |
get(java.lang.Object key)
This method will return null for every given key. |
boolean |
isEmpty()
This method will always return true, because this map will always be empty. |
java.util.Set<K> |
keySet()
This method will return an empty set (in fact an instance of DummySet). |
V |
put(K key,
V value)
This Method does not store anything but will return null for each key, value pair. |
void |
putAll(java.util.Map<? extends K,? extends V> m)
This Method does nothing. |
V |
remove(java.lang.Object key)
This Method does not remove anything but will return true for each Object key. |
int |
size()
This Method will always return 0 because the map is always empty. |
java.util.Collection<V> |
values()
This method will return an empty set (an instance of DummySet). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Map |
---|
equals, hashCode |
Constructor Detail |
---|
public DummyMap()
Method Detail |
---|
public void clear()
clear
in interface java.util.Map<K,V>
Map.clear()
public final boolean containsKey(java.lang.Object key)
containsKey
in interface java.util.Map<K,V>
Map.containsKey(java.lang.Object)
public final boolean containsValue(java.lang.Object value)
containsValue
in interface java.util.Map<K,V>
Map.containsValue(java.lang.Object)
public final java.util.Set<java.util.Map.Entry<K,V>> entrySet()
entrySet
in interface java.util.Map<K,V>
Map.entrySet()
public final V get(java.lang.Object key)
get
in interface java.util.Map<K,V>
Map.get(java.lang.Object)
public final boolean isEmpty()
isEmpty
in interface java.util.Map<K,V>
Map.isEmpty()
public final java.util.Set<K> keySet()
keySet
in interface java.util.Map<K,V>
Map.keySet()
public final V put(K key, V value)
put
in interface java.util.Map<K,V>
Map.put(java.lang.Object, java.lang.Object)
public final void putAll(java.util.Map<? extends K,? extends V> m)
putAll
in interface java.util.Map<K,V>
Map.putAll(java.util.Map)
public final V remove(java.lang.Object key)
remove
in interface java.util.Map<K,V>
Map.remove(java.lang.Object)
public final int size()
size
in interface java.util.Map<K,V>
Map.size()
public final java.util.Collection<V> values()
values
in interface java.util.Map<K,V>
Map.values()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |