Class ObservableMapImpl<K,V>
java.lang.Object
java.util.AbstractMap<K,V>
org.aksw.commons.collection.observable.ObservableMapImpl<K,V>
- Type Parameters:
K-V-
- All Implemented Interfaces:
Map<K,,V> ObservableMap<K,V>
A map the fires events on changes. Changes are also triggered on operations
on the
entrySet() and .entrySet().iterater().remove().
Changes are tracked in a CollectionChangedEventImpl instance which implements PropertyChangeEvent.
The old value is the this map before the change, and the new value is a view with the pending changes applied.
Hence, no needless copying in performed. Event handlers need to to make copies if they want a static
snapshot using e.g. new LinkedHashMap<>((Map<Foo,Bar>)event.getNewValue())
TODO keySet() entrySt and values() should return ObservableCollections.- Author:
- raven
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()booleancontainsKey(Object key) booleancontainsValue(Object value) static <K,V> ObservableMap<K, V> protected VdoRemoveEntry(K key, V v) entrySet()TODO The result should be an ObservableSetkeySet()protected voidvalues()Methods inherited from class java.util.AbstractMap
clone, equals, get, hashCode, isEmpty, putAll, size, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, get, getOrDefault, hashCode, isEmpty, merge, putAll, putIfAbsent, remove, replace, replace, replaceAll, sizeMethods inherited from interface org.aksw.commons.collection.observable.ObservableMap
observeKey, observeKey
-
Field Details
-
delegate
-
vcs
-
pcs
-
-
Constructor Details
-
ObservableMapImpl
-
-
Method Details
-
decorate
-
addVetoableChangeListener
- Specified by:
addVetoableChangeListenerin interfaceObservableMap<K,V>
-
addPropertyChangeListener
- Specified by:
addPropertyChangeListenerin interfaceObservableMap<K,V>
-
put
-
remove
-
doRemoveEntry
-
notifyClear
protected void notifyClear() -
containsKey
- Specified by:
containsKeyin interfaceMap<K,V> - Overrides:
containsKeyin classAbstractMap<K,V>
-
containsValue
- Specified by:
containsValuein interfaceMap<K,V> - Overrides:
containsValuein classAbstractMap<K,V>
-
clear
public void clear() -
entrySet
TODO The result should be an ObservableSet -
keySet
-
values
-