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 TypeMethodDescriptionvoidaddListener(MultisetChangeListener<? super E> listener) Adds aMultisetChangeListenerto thisObservableMultiset.voidremoveListener(MultisetChangeListener<? super E> listener) Removes aMultisetChangeListenerfrom thisObservableMultiset.booleanreplaceAll(Multiset<? extends E> multiset) Replaces all the contents of theObservableMultisetwith the contents provided by the givenMultiset.Methods inherited from interface java.util.Collection
addAll, clear, isEmpty, parallelStream, removeIf, stream, toArray, toArray, toArrayMethods 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, toStringMethods inherited from interface javafx.beans.Observable
addListener, removeListener
-
Method Details
-
addListener
Adds aMultisetChangeListenerto thisObservableMultiset. If the same listener is registered more than once, it will be notified more than once.- Parameters:
listener- TheMultisetChangeListenerto add.
-
removeListener
Removes aMultisetChangeListenerfrom 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- TheMultisetChangeListenerto remove.
-
replaceAll
Replaces all the contents of theObservableMultisetwith the contents provided by the givenMultiset.- Parameters:
multiset- TheMultisetwhose values should be used to replace those of thisObservableMultiset.- Returns:
- Whether this map was changed through the replace operation.
-