Class MultisetListenerHelper<E>
java.lang.Object
org.eclipse.gef.common.collections.MultisetListenerHelper<E>
- Type Parameters:
E
- The element type of theObservableMultiset
.
- Direct Known Subclasses:
MultisetExpressionHelper
A utility class to support change notifications for an
ObservableMultiset
.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
A simple implementation of anMultisetChangeListener.Change
.static class
An elementary change related to a single element of aMultiset
. -
Constructor Summary
ConstructorsConstructorDescriptionMultisetListenerHelper
(ObservableMultiset<E> source) Constructs a newMultisetListenerHelper
for the given sourceObservableMultiset
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(javafx.beans.InvalidationListener listener) Adds a newInvalidationListener
to thisMultisetListenerHelper
.void
addListener
(MultisetChangeListener<? super E> listener) Adds a newSetMultimapChangeListener
to thisMultisetListenerHelper
.void
fireValueChangedEvent
(MultisetChangeListener.Change<? extends E> change) Notifies all attachedInvalidationListener
s andMultisetChangeListener
s about the change.protected ObservableMultiset<E>
Returns the sourceObservableMultiset
thisMultisetListenerHelper
is bound to, which is used in change notifications.protected void
Notifies all registeredInvalidationListener
s.protected void
notifyMultisetChangeListeners
(MultisetChangeListener.Change<? extends E> change) Notifies the attachedMultisetChangeListener
s about the related change.void
removeListener
(javafx.beans.InvalidationListener listener) Removes the givenInvalidationListener
from thisMultisetListenerHelper
.void
removeListener
(MultisetChangeListener<? super E> listener) Removes the givenMultisetChangeListener
from thisMultisetListenerHelper
.
-
Constructor Details
-
MultisetListenerHelper
Constructs a newMultisetListenerHelper
for the given sourceObservableMultiset
.- Parameters:
source
- TheObservableMultiset
to use as source in change notifications.
-
-
Method Details
-
addListener
public void addListener(javafx.beans.InvalidationListener listener) Adds a newInvalidationListener
to thisMultisetListenerHelper
. 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
Adds a newSetMultimapChangeListener
to thisMultisetListenerHelper
. 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
Notifies all attachedInvalidationListener
s andMultisetChangeListener
s about the change.- Parameters:
change
- The change to notify listeners about.
-
getSource
Returns the sourceObservableMultiset
thisMultisetListenerHelper
is bound to, which is used in change notifications.- Returns:
- The source
ObservableMultiset
.
-
notifyInvalidationListeners
protected void notifyInvalidationListeners()Notifies all registeredInvalidationListener
s. -
notifyMultisetChangeListeners
Notifies the attachedMultisetChangeListener
s about the related change.- Parameters:
change
- The applied change.
-
removeListener
public void removeListener(javafx.beans.InvalidationListener listener) Removes the givenInvalidationListener
from thisMultisetListenerHelper
. If its was registered more than once, removes one occurrence.- Parameters:
listener
- The listener to remove.
-
removeListener
Removes the givenMultisetChangeListener
from thisMultisetListenerHelper
. If its was registered more than once, removes one occurrence.- Parameters:
listener
- The listener to remove.
-