Package com.sun.javafx.collections
Class ObservableMapWrapper<K,V>
java.lang.Object
com.sun.javafx.collections.ObservableMapWrapper<K,V>
- All Implemented Interfaces:
Map<K,,V> Observable,ObservableMap<K,V>
A Map wrapper class that implements observability.
-
Nested Class Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(InvalidationListener listener) Adds anInvalidationListenerwhich will be notified whenever theObservablebecomes invalid.voidaddListener(MapChangeListener<? super K, ? super V> observer) Add a listener to this observable map.protected voidcallObservers(MapChangeListener.Change<K, V> change) voidclear()booleancontainsKey(Object key) booleancontainsValue(Object value) entrySet()booleaninthashCode()booleanisEmpty()keySet()voidvoidremoveListener(InvalidationListener listener) Removes the given listener from the list of listeners, that are notified whenever the value of theObservablebecomes invalid.voidremoveListener(MapChangeListener<? super K, ? super V> observer) Tries to removed a listener from this observable map.intsize()toString()values()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
ObservableMapWrapper
-
-
Method Details
-
callObservers
-
addListener
Description copied from interface:ObservableAdds anInvalidationListenerwhich will be notified whenever theObservablebecomes invalid. If the same listener is added more than once, then it will be notified more than once. That is, no check is made to ensure uniqueness.Note that the same actual
InvalidationListenerinstance may be safely registered for differentObservables.The
Observablestores a strong reference to the listener which will prevent the listener from being garbage collected and may result in a memory leak. It is recommended to either unregister a listener by callingremoveListenerafter use or to use an instance ofWeakInvalidationListeneravoid this situation.- Specified by:
addListenerin interfaceObservable- Parameters:
listener- The listener to register- See Also:
-
removeListener
Description copied from interface:ObservableRemoves the given listener from the list of listeners, that are notified whenever the value of theObservablebecomes invalid.If the given listener has not been previously registered (i.e. it was never added) then this method call is a no-op. If it had been previously added then it will be removed. If it had been added more than once, then only the first occurrence will be removed.
- Specified by:
removeListenerin interfaceObservable- Parameters:
listener- The listener to remove- See Also:
-
addListener
Description copied from interface:ObservableMapAdd a listener to this observable map.- Specified by:
addListenerin interfaceObservableMap<K,V> - Parameters:
observer- the listener for listening to the list changes
-
removeListener
Description copied from interface:ObservableMapTries to removed a listener from this observable map. If the listener is not attached to this map, nothing happens.- Specified by:
removeListenerin interfaceObservableMap<K,V> - Parameters:
observer- a listener to remove
-
size
public int size() -
isEmpty
public boolean isEmpty() -
containsKey
- Specified by:
containsKeyin interfaceMap<K,V>
-
containsValue
- Specified by:
containsValuein interfaceMap<K,V>
-
get
-
put
-
remove
-
putAll
-
clear
public void clear() -
keySet
-
values
-
entrySet
-
toString
-
equals
-
hashCode
public int hashCode()
-