Interface ObservableMultiset<E>
-
- Type Parameters:
E
- The element type of theMultiset
.
- All Superinterfaces:
java.util.Collection<E>
,java.lang.Iterable<E>
,Multiset<E>
,javafx.beans.Observable
- All Known Subinterfaces:
ObservableMultisetValue<E>
,WritableMultisetValue<E>
- All Known Implementing Classes:
MultisetBinding
,MultisetExpression
,MultisetProperty
,MultisetPropertyBase
,ReadOnlyMultisetProperty
,ReadOnlyMultisetPropertyBase
,ReadOnlyMultisetWrapper
,SimpleMultisetProperty
public interface ObservableMultiset<E> extends Multiset<E>, javafx.beans.Observable
AnObservableMultiset
is a specificMultiset
that allows observers to track changes by registeringMultisetChangeListeners
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.google.common.collect.Multiset
Multiset.Entry<E extends java.lang.Object>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addListener(MultisetChangeListener<? super E> listener)
Adds aMultisetChangeListener
to thisObservableMultiset
.void
removeListener(MultisetChangeListener<? super E> listener)
Removes aMultisetChangeListener
from thisObservableMultiset
.boolean
replaceAll(Multiset<? extends E> multiset)
Replaces all the contents of theObservableMultiset
with the contents provided by the givenMultiset
.-
Methods inherited from interface java.util.Collection
addAll, clear, isEmpty, parallelStream, removeIf, stream, toArray, toArray, toArray
-
-
-
-
Method Detail
-
addListener
void addListener(MultisetChangeListener<? super E> listener)
Adds aMultisetChangeListener
to thisObservableMultiset
. If the same listener is registered more than once, it will be notified more than once.- Parameters:
listener
- TheMultisetChangeListener
to add.
-
removeListener
void removeListener(MultisetChangeListener<? super E> listener)
Removes aMultisetChangeListener
from thisObservableMultiset
. Will do nothing if the listener was not attached to thisObservableMultiset
. If it was added more than once, then only the first occurrence will be removed.- Parameters:
listener
- TheMultisetChangeListener
to remove.
-
replaceAll
boolean replaceAll(Multiset<? extends E> multiset)
Replaces all the contents of theObservableMultiset
with the contents provided by the givenMultiset
.- Parameters:
multiset
- TheMultiset
whose values should be used to replace those of thisObservableMultiset
.- Returns:
- Whether this map was changed through the replace operation.
-
-