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
AnObservableMultisetis a specificMultisetthat 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 voidaddListener(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, toArray
-
-
-
-
Method Detail
-
addListener
void addListener(MultisetChangeListener<? super E> listener)
Adds aMultisetChangeListenerto thisObservableMultiset. If the same listener is registered more than once, it will be notified more than once.- Parameters:
listener- TheMultisetChangeListenerto add.
-
removeListener
void removeListener(MultisetChangeListener<? super E> listener)
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
boolean replaceAll(Multiset<? extends E> multiset)
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.
-
-