Interface ObservableMultiset<E>
- Type Parameters:
E
- The element type of theMultiset
.
- All Superinterfaces:
Collection<E>
,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
An
ObservableMultiset
is a specific Multiset
that allows
observers to track changes by registering MultisetChangeListeners
.-
Nested Class Summary
Nested classes/interfaces inherited from interface com.google.common.collect.Multiset
Multiset.Entry<E extends Object>
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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
Methods inherited from interface com.google.common.collect.Multiset
add, add, contains, containsAll, count, elementSet, entrySet, equals, forEach, forEachEntry, hashCode, iterator, remove, remove, removeAll, retainAll, setCount, setCount, size, spliterator, toString
Methods inherited from interface javafx.beans.Observable
addListener, removeListener
-
Method Details
-
addListener
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
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
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.
-