Package org.eclipse.gef.common.collections

# Interface ObservableMultiset<E>

Type Parameters:
  `E` - The element type of the `Multiset`.

All Superinterfaces:
  `Collection<E>`, `Iterable<E>`, `Multiset<E>`, `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>, Observable
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 Type
Method
Description
`void`
`addListener(MultisetChangeListener<? super E> listener)`
Adds a `MultisetChangeListener` to this `ObservableMultiset`.
`void`
`removeListener(MultisetChangeListener<? super E> listener)`
Removes a `MultisetChangeListener` from this `ObservableMultiset`.
`boolean`
`replaceAll(Multiset<? extends E> multiset)`
Replaces all the contents of the `ObservableMultiset` with the contents provided by the given `Multiset`.

### 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

void addListener(MultisetChangeListener<? super E> listener)
Adds a `MultisetChangeListener` to this `ObservableMultiset`. If the same listener is registered more than once, it will be notified more than once.

Parameters:
  `listener` - The `MultisetChangeListener` to add.

### removeListener

void removeListener(MultisetChangeListener<? super E> listener)
Removes a `MultisetChangeListener` from this `ObservableMultiset`. Will do nothing if the listener was not attached to this `ObservableMultiset`. If it was added more than once, then only the first occurrence will be removed.

Parameters:
  `listener` - The `MultisetChangeListener` to remove.

### replaceAll

boolean replaceAll(Multiset<? extends E> multiset)
Replaces all the contents of the `ObservableMultiset` with the contents provided by the given `Multiset`.

Parameters:
  `multiset` - The `Multiset` whose values should be used to replace those of this `ObservableMultiset`.
Returns:
  Whether this map was changed through the replace operation.