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>

public interface ObservableCollection<V> extends Collection<V>
ObservableCollection interface represents an object with a model being a Collection that allows for pluggable notifications for occurring changes.
  • Method Details

    • addListener

      void 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. This has the same result as the following call:
         addListener(listener, (Filter) null, false);
       
      Parameters:
      listener - the CollectionEvent listener to add
    • removeListener

      void removeListener(CollectionListener<? super V> listener)
      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

      void addListener(CollectionListener<? super V> listener, Filter<V> filter, boolean fLite)
      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 - the CollectionEvent listener to add
      filter - 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 (see MapEventFilter); null is equivalent to a filter that always returns true
      fLite - true to indicate that the CollectionEvent objects do not have to include the OldValue and NewValue property values in order to allow optimizations
    • removeListener

      void removeListener(CollectionListener<? super V> listener, Filter<V> filter)
      Remove a collection listener that previously signed up for events based on a filter evaluation.
      Parameters:
      listener - the listener to remove
      filter - the filter that was passed into the corresponding addCollectionListener() call