com.taco.data
Interface IObservableMap

All Superinterfaces:
java.util.Map
All Known Subinterfaces:
IDelayedResultObservableMap, INoReturnObservableMap
All Known Implementing Classes:
DelayedResultObservableMap, ObservableMap, WrappedObservableMap

public interface IObservableMap
extends java.util.Map

A map that notifies listeners when its values are changed.


Nested Class Summary
static interface IObservableMap.IObservableEntry
          A map entry whose associated listeners can be modified.
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry
 
Field Summary
static INotificationStrategy SINGLE_THREADED_STRATEGY
          An instance of INotificationStrategy which notifies all listeners in order using the same thread.
 
Method Summary
 void addPropertyChangeListener(java.lang.String key, java.beans.PropertyChangeListener listener)
          Add listener to the list of listeners to notify when the value associated with key is changed.
 INotificationStrategy getNotificationStrategy()
          Return the strategy used to notify listeners of key changes.
 java.util.Collection getPropertyChangeListeners(java.lang.String key)
          Return a copy of the collection of listeners of changes to values associated with the argument key.
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
          Put the key-value pair in the map.
 java.lang.Object put(java.lang.Object key, java.lang.Object value, boolean notifyListeners)
          Put the key-value pair in the map.
 java.lang.Object put(java.lang.Object key, java.lang.Object value, IObjectFilter listenerFilter)
          Put the key-value pair in the map.
 void putAll(java.util.Map source)
          Copy all of the mappings from the specified map to this map.
 void putAll(java.util.Map source, boolean notifyListeners)
          Copy all of the mappings from the specified map to this map.
 void putAll(java.util.Map source, IObjectFilter listenerFilter)
          Copy all of the mappings from the specified map to this map.
 void removePropertyChangeListener(java.lang.String key, java.beans.PropertyChangeListener listener)
          Remove listener from the list of listeners to notify when the value associated with key is changed.
 void setNotificationStrategy(INotificationStrategy strategy)
          Set the strategy used to notify listeners of key changes.
 void setPropertyChangeListeners(java.lang.String key, java.util.Collection listeners)
          Set the collection of listeners to be notified when the value associated with key is changed.
 
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, remove, size, values
 

Field Detail

SINGLE_THREADED_STRATEGY

static final INotificationStrategy SINGLE_THREADED_STRATEGY
An instance of INotificationStrategy which notifies all listeners in order using the same thread.

Method Detail

put

java.lang.Object put(java.lang.Object key,
                     java.lang.Object value)
Put the key-value pair in the map. Notify all listeners for argument key of the change. This is equivalent to put(key, value, true).

Specified by:
put in interface java.util.Map

put

java.lang.Object put(java.lang.Object key,
                     java.lang.Object value,
                     boolean notifyListeners)
Put the key-value pair in the map. If notifyListeners is true, notify all listeners for argument key of the change.


put

java.lang.Object put(java.lang.Object key,
                     java.lang.Object value,
                     IObjectFilter listenerFilter)
Put the key-value pair in the map. Notify all listeners for the argument key that are accepted by the filter of of the change.


putAll

void putAll(java.util.Map source)
Copy all of the mappings from the specified map to this map. Notify all listeners of the affected keys of the changes. This is equivalent to putAll(source, true).

Specified by:
putAll in interface java.util.Map

putAll

void putAll(java.util.Map source,
            boolean notifyListeners)
Copy all of the mappings from the specified map to this map. If notifyListeners is true, notify all listeners of the affected keys of the changes.


putAll

void putAll(java.util.Map source,
            IObjectFilter listenerFilter)
Copy all of the mappings from the specified map to this map. If notifyListeners is true, notify all listeners of the affected keys that are accepted by the filter of the changes.


addPropertyChangeListener

void addPropertyChangeListener(java.lang.String key,
                               java.beans.PropertyChangeListener listener)
Add listener to the list of listeners to notify when the value associated with key is changed.


removePropertyChangeListener

void removePropertyChangeListener(java.lang.String key,
                                  java.beans.PropertyChangeListener listener)
Remove listener from the list of listeners to notify when the value associated with key is changed. If listener is not on the list, fail silently.


getPropertyChangeListeners

java.util.Collection getPropertyChangeListeners(java.lang.String key)
Return a copy of the collection of listeners of changes to values associated with the argument key. If no listeners are present, return an empty collection.


setPropertyChangeListeners

void setPropertyChangeListeners(java.lang.String key,
                                java.util.Collection listeners)
Set the collection of listeners to be notified when the value associated with key is changed. If listeners is null, do not notify any listener. A copy of the argument collection is made so the user is free to modify it afterwards.


getNotificationStrategy

INotificationStrategy getNotificationStrategy()
Return the strategy used to notify listeners of key changes.


setNotificationStrategy

void setNotificationStrategy(INotificationStrategy strategy)
Set the strategy used to notify listeners of key changes.