Decorates a SortedMap implementation with a bound
property named "collection".
Each modifying method call made on this SortedMap is
handled as a change to the "collection" property. This
facility serves to notify subscribers of a change to the collection
but does not allow users the option of vetoing the change. To
gain the ability to veto the change, use a
ConstrainedSortedMap decorater.
Due to the fact that a Map offers several "views" of the
same data, some confusion may arise as to what action caused a
particular event. For instance, entries in the map may be
deleted by Map.values().remove(object) . There is no
known method, short of digging into the implementation of a Map,
to determine which key-value pair was deleted by this operation,
particularly if there is more than one occurence of a specific
value. (Conversely, there is also no means of controlling which
key-value pair is deleted by this method; therefore it's not a
terribly smart thing to do.)
This implementation of a bound map makes no attempt to interpret
events generated by these alternate views of the data. It merely
ensures that registered listeners receive all events generated
by any view of the Map's data. It is left to the client
to interpret the events generated by their map's usage.
See Also: BoundMap since: Commons Events 1.0 author: Bryce Nordgren / USDA Forest Service |