Interface ObservableMap<K,V>
- Type Parameters:
K- the map key element typeV- the map value element type
- All Superinterfaces:
Map<K,V>, Observable
- All Known Subinterfaces:
ObservableMapValue<K,V>, Platform.Preferences, WritableMapValue<K, V>
- All Known Implementing Classes:
MapBinding, MapExpression, MapProperty, MapPropertyBase, ReadOnlyMapProperty, ReadOnlyMapPropertyBase, ReadOnlyMapWrapper, SimpleMapProperty
A map that allows observers to track changes when they occur. Implementations can be created using methods in
FXCollections
such as observableHashMap, or with a
SimpleMapProperty.- Implementation Note:
- The implementations of this interface in the JavaFX library do not provide all of the
guarantees described by
Observablefor their invalidation listeners: a listener that is added or removed while a notification is in progress may still be notified. - Since:
- JavaFX 2.0
- See Also:
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(MapChangeListener<? super K, ? super V> listener) Add a listener to this observable map.voidremoveListener(MapChangeListener<? super K, ? super V> listener) Tries to removed a listener from this observable map.Methods declared in interface Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuesMethods declared in interface Observable
addListener, removeListener, subscribe
-
Method Details
-
addListener
Add a listener to this observable map.- Parameters:
listener- the listener for listening to the list changes
-
removeListener
Tries to removed a listener from this observable map. If the listener is not attached to this map, nothing happens.- Parameters:
listener- a listener to remove
-