Package org.eclipse.gef.common.collections

## Class SetMultimapListenerHelper<K,​V>

- java.lang.Object
- - org.eclipse.gef.common.collections.SetMultimapListenerHelper<K,​V>

Type Parameters:
  `K` - The key type of the `ObservableSetMultimap`.
  `V` - The value type of the `ObservableSetMultimap`.

Direct Known Subclasses:
  `SetMultimapExpressionHelper`

    public class SetMultimapListenerHelper<K,​V>
    extends java.lang.Object

A utility class to support change notifications for an `ObservableSetMultimap`.

### Nested Class Summary

Nested Classes
`static class` `SetMultimapListenerHelper.AtomicChange<K,​V>` A simple implementation of an `SetMultimapChangeListener.Change`.
`static class` `SetMultimapListenerHelper.ElementarySubChange<K,​V>` An elementary change related to a single key of a `ObservableSetMultimap`. .

### Constructor Summary

Constructors
`SetMultimapListenerHelper​(ObservableSetMultimap<K,​V> source)` Constructs a new `SetMultimapListenerHelper` for the given source `ObservableSetMultimap`.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addListener​(javafx.beans.InvalidationListener listener)` Adds a new `InvalidationListener` to this `SetMultimapListenerHelper`.
`void` `addListener​(SetMultimapChangeListener<? super K,​? super V> listener)` Adds a new `SetMultimapChangeListener` to this `SetMultimapListenerHelper`.
`void` `fireValueChangedEvent​(SetMultimapChangeListener.Change<? extends K,​? extends V> change)` Notifies all attached `InvalidationListener`s and `SetMultimapChangeListener`s about the change.
`protected ObservableSetMultimap<K,​V>` `getSource()` Returns the source `ObservableSetMultimap` this `SetMultimapListenerHelper` is bound to, which is used in change notifications.
`protected void` `notifyInvalidationListeners()` Notifies all registered `InvalidationListener`s.
`protected void` `notifySetMultimapChangeListeners​(SetMultimapChangeListener.Change<? extends K,​? extends V> change)` Notifies the attached `SetMultimapChangeListener`s about the related change.
`void` `removeListener​(javafx.beans.InvalidationListener listener)` Removes the given `InvalidationListener` from this `SetMultimapListenerHelper`.
`void` `removeListener​(SetMultimapChangeListener<? super K,​? super V> listener)` Removes the given `SetMultimapChangeListener` from this `SetMultimapListenerHelper`.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### SetMultimapListenerHelper

    public SetMultimapListenerHelper​(ObservableSetMultimap<K,​V> source)

Constructs a new `SetMultimapListenerHelper` for the given source `ObservableSetMultimap`.

Parameters:
  `source` - The `ObservableSetMultimap` to use as source in change notifications.

### Method Detail

#### addListener

    public void addListener​(javafx.beans.InvalidationListener listener)

Adds a new `InvalidationListener` to this `SetMultimapListenerHelper`. If the same listener is added more than once, it will be registered more than once and will receive multiple change events.

Parameters:
  `listener` - The listener to add.

#### addListener

    public void addListener​(SetMultimapChangeListener<? super K,​? super V> listener)

Adds a new `SetMultimapChangeListener` to this `SetMultimapListenerHelper`. If the same listener is added more than once, it will be registered more than once and will receive multiple change events.

Parameters:
  `listener` - The listener to add.

#### fireValueChangedEvent

    public void fireValueChangedEvent​(SetMultimapChangeListener.Change<? extends K,​? extends V> change)

Notifies all attached `InvalidationListener`s and `SetMultimapChangeListener`s about the change.

Parameters:
  `change` - The change to notify listeners about.

#### getSource

    protected ObservableSetMultimap<K,​V> getSource()

Returns the source `ObservableSetMultimap` this `SetMultimapListenerHelper` is bound to, which is used in change notifications.

Returns:
  The source `ObservableSetMultimap`.

#### notifyInvalidationListeners

    protected void notifyInvalidationListeners()

Notifies all registered `InvalidationListener`s.

#### notifySetMultimapChangeListeners

    protected void notifySetMultimapChangeListeners​(SetMultimapChangeListener.Change<? extends K,​? extends V> change)

Notifies the attached `SetMultimapChangeListener`s about the related change.

Parameters:
  `change` - The applied change.

#### removeListener

    public void removeListener​(javafx.beans.InvalidationListener listener)

Removes the given `InvalidationListener` from this `SetMultimapListenerHelper`. If its was registered more than once, removes one occurrence.

Parameters:
  `listener` - The listener to remove.

#### removeListener

    public void removeListener​(SetMultimapChangeListener<? super K,​? super V> listener)

Removes the given `SetMultimapChangeListener` from this `SetMultimapListenerHelper`. If its was registered more than once, removes one occurrence.

Parameters:
  `listener` - The listener to remove.