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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(InvalidationListener listener) Adds anInvalidationListener
which will be notified whenever theObservable
becomes invalid.void
addListener
(MapChangeListener<? super K, ? super V> observer) Add a listener to this observable map.protected void
callObservers
(MapChangeListener.Change<K, V> change) void
clear()
boolean
containsKey
(Object key) boolean
containsValue
(Object value) entrySet()
boolean
int
hashCode()
boolean
isEmpty()
keySet()
void
void
removeListener
(InvalidationListener listener) Removes the given listener from the list of listeners, that are notified whenever the value of theObservable
becomes invalid.void
removeListener
(MapChangeListener<? super K, ? super V> observer) Tries to removed a listener from this observable map.int
size()
toString()
values()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods 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:Observable
Adds anInvalidationListener
which will be notified whenever theObservable
becomes 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
InvalidationListener
instance may be safely registered for differentObservables
.The
Observable
stores 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 callingremoveListener
after use or to use an instance ofWeakInvalidationListener
avoid this situation.- Specified by:
addListener
in interfaceObservable
- Parameters:
listener
- The listener to register- See Also:
-
removeListener
Description copied from interface:Observable
Removes the given listener from the list of listeners, that are notified whenever the value of theObservable
becomes 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:
removeListener
in interfaceObservable
- Parameters:
listener
- The listener to remove- See Also:
-
addListener
Description copied from interface:ObservableMap
Add a listener to this observable map.- Specified by:
addListener
in interfaceObservableMap<K,
V> - Parameters:
observer
- the listener for listening to the list changes
-
removeListener
Description copied from interface:ObservableMap
Tries to removed a listener from this observable map. If the listener is not attached to this map, nothing happens.- Specified by:
removeListener
in interfaceObservableMap<K,
V> - Parameters:
observer
- a listener to remove
-
size
public int size() -
isEmpty
public boolean isEmpty() -
containsKey
- Specified by:
containsKey
in interfaceMap<K,
V>
-
containsValue
- Specified by:
containsValue
in interfaceMap<K,
V>
-
get
-
put
-
remove
-
putAll
-
clear
public void clear() -
keySet
-
values
-
entrySet
-
toString
-
equals
-
hashCode
public int hashCode()
-