Package com.tangosol.util
Interface ObservableCollection<V>
- Type Parameters:
V
- the type of the Collection values
- All Superinterfaces:
Collection<V>
,Iterable<V>
- All Known Subinterfaces:
NamedBlockingDeque<E>
,NamedBlockingQueue<E>
,NamedDeque<E>
,NamedQueue<E>
- All Known Implementing Classes:
NamedDequeProxy
,NamedQueueProxy
,com.tangosol.net.queue.WrapperNamedDeque
,com.tangosol.net.queue.WrapperNamedQueue
ObservableCollection interface represents an object with a model being
a Collection that allows for pluggable notifications for occurring changes.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(CollectionListener<? super V> listener) Add a standard collection listener that will receive all events (inserts, updates, deletes) that occur against the collection, with the old-value and new-value included.void
addListener
(CollectionListener<? super V> listener, Filter<V> filter, boolean fLite) Add a collection listener that receives events based on a filter evaluation.void
removeListener
(CollectionListener<? super V> listener) Remove a standard collection listener that previously signed up for all events.void
removeListener
(CollectionListener<? super V> listener, Filter<V> filter) Remove a collection listener that previously signed up for events based on a filter evaluation.
-
Method Details
-
addListener
Add a standard collection listener that will receive all events (inserts, updates, deletes) that occur against the collection, with the old-value and new-value included. This has the same result as the following call:addListener(listener, (Filter) null, false);
- Parameters:
listener
- theCollectionEvent
listener to add
-
removeListener
Remove a standard collection listener that previously signed up for all events. This has the same result as the following call:removeListener(listener, (Filter) null);
- Parameters:
listener
- the listener to remove
-
addListener
Add a collection listener that receives events based on a filter evaluation.The listeners will receive CollectionEvent objects, but if fLite is passed as true, they might not contain the OldValue and NewValue properties.
To unregister the Listener, use the
removeListener(CollectionListener, Filter)
method.- Parameters:
listener
- theCollectionEvent
listener to addfilter
- a filter that will be passed CollectionEvent objects to select from; a CollectionEvent will be delivered to the listener only if the filter evaluates to true for that CollectionEvent (seeMapEventFilter
); null is equivalent to a filter that always returns truefLite
- true to indicate that theCollectionEvent
objects do not have to include the OldValue and NewValue property values in order to allow optimizations
-
removeListener
Remove a collection listener that previously signed up for events based on a filter evaluation.- Parameters:
listener
- the listener to removefilter
- the filter that was passed into the corresponding addCollectionListener() call
-