Package org.apache.pivot.collections
Interface MapListener<K,V>
-
- Type Parameters:
K
- Type of key object used in this map.V
- Type of value object stored for each key.
- All Known Implementing Classes:
MapListener.Adapter
,MapListener.Listeners
public interface MapListener<K,V>
Map listener interface.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
MapListener.Adapter<K,V>
Deprecated.Since 2.1 and Java 8 the interface itself has default implementations.static class
MapListener.Listeners<K,V>
Map listeners.
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default void
comparatorChanged(Map<K,V> map, java.util.Comparator<K> previousComparator)
Called when a map's comparator has changed.default void
mapCleared(Map<K,V> map)
Called when map data has been reset.default void
valueAdded(Map<K,V> map, K key)
Called when a key/value pair has been added to a map.default void
valueRemoved(Map<K,V> map, K key, V value)
Called when a key/value pair has been removed from a map.default void
valueUpdated(Map<K,V> map, K key, V previousValue)
Called when a map value has been updated.
-
-
-
Method Detail
-
valueAdded
default void valueAdded(Map<K,V> map, K key)
Called when a key/value pair has been added to a map.- Parameters:
map
- The source of the map event.key
- The key that was added to the map.
-
valueUpdated
default void valueUpdated(Map<K,V> map, K key, V previousValue)
Called when a map value has been updated.- Parameters:
map
- The source of the map event.key
- The key whose value was updated.previousValue
- The value that was previously associated with the key.
-
valueRemoved
default void valueRemoved(Map<K,V> map, K key, V value)
Called when a key/value pair has been removed from a map.- Parameters:
map
- The source of the map event.key
- The key that was removed.value
- The value that was removed.
-
mapCleared
default void mapCleared(Map<K,V> map)
Called when map data has been reset.- Parameters:
map
- The source of the map event.
-
-