public class DeltaMap<K,V> extends AbstractMap<K,V>
AbstractMap.SimpleImmutableEntry<K,V>| Constructor and Description |
|---|
DeltaMap(Map<K,V> originalMap) |
DeltaMap(Map<K,V> originalMap,
MapFactory<K,V> mf)
This is very cheap.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
This is more expensive than normal.
|
boolean |
containsKey(Object key)
This is more expensive.
|
Set<Map.Entry<K,V>> |
entrySet()
This is cheap.
|
V |
get(Object key)
This may cost twice what it would in the original Map.
|
static void |
main(String[] args)
For testing only.
|
V |
put(K key,
V value)
This may cost twice what it would in the original Map because we have to find
the original value for this key.
|
V |
remove(Object key) |
public DeltaMap(Map<K,V> originalMap, MapFactory<K,V> mf)
originalMap - will serve as the basis for this DeltaMappublic boolean containsKey(Object key)
containsKey in interface Map<K,V>containsKey in class AbstractMap<K,V>key - key whose presence in this map is to be tested.public V put(K key, V value)
put in interface Map<K,V>put in class AbstractMap<K,V>key - key with which the specified value is to be associated.value - value to be associated with the specified key.public void clear()
public static void main(String[] args)
args - from command line