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 Object
A utility class to support change notifications for an `ObservableSetMultimap`.

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`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
Constructor
Description
`SetMultimapListenerHelper(ObservableSetMultimap<K,V> source)`
Constructs a new `SetMultimapListenerHelper` for the given source `ObservableSetMultimap`.

## Method Summary

Modifier and Type
Method
Description
`void`
`addListener(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(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 Details

### 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 Details

### addListener

public void addListener(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(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.