android.databinding
Interface ObservableMap<K,V>

All Superinterfaces:
java.util.Map<K,V>

public interface ObservableMap<K,V>
extends java.util.Map<K,V>

A Map that notifies when items change. This kind of Map may be data bound and have the UI update as the map changes.

Implementers must call ObservableMap.OnMapChangedCallback.onMapChanged(ObservableMap, Object) whenever an item is added, changed, or removed.

ObservableArrayMap is a convenient implementation of ObservableMap. MapChangeRegistry may help other implementations manage the callbacks.

See Also:
Observable, ObservableList

Nested Class Summary
static class ObservableMap.OnMapChangedCallback<T extends ObservableMap<K,V>,K,V>
          A callback receiving notifications when an ObservableMap changes.
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Method Summary
 void addOnMapChangedCallback(ObservableMap.OnMapChangedCallback<? extends ObservableMap<K,V>,K,V> callback)
          Adds a callback to listen for changes to the ObservableMap.
 void removeOnMapChangedCallback(ObservableMap.OnMapChangedCallback<? extends ObservableMap<K,V>,K,V> callback)
          Removes a previously added callback.
 
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 

Method Detail

addOnMapChangedCallback

void addOnMapChangedCallback(ObservableMap.OnMapChangedCallback<? extends ObservableMap<K,V>,K,V> callback)
Adds a callback to listen for changes to the ObservableMap.

Parameters:
callback - The callback to start listening for events.

removeOnMapChangedCallback

void removeOnMapChangedCallback(ObservableMap.OnMapChangedCallback<? extends ObservableMap<K,V>,K,V> callback)
Removes a previously added callback.

Parameters:
callback - The callback that no longer needs to be notified of map changes.