org.eclipse.gef.common.beans.binding

## Class MultisetExpression<E>

- java.lang.Object
- - org.eclipse.gef.common.beans.binding.MultisetExpression<E>

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

All Implemented Interfaces:
  Multiset<E>, java.lang.Iterable<E>, java.util.Collection<E>, javafx.beans.Observable, javafx.beans.value.ObservableObjectValue<ObservableMultiset<E>>, javafx.beans.value.ObservableValue<ObservableMultiset<E>>, ObservableMultisetValue<E>, ObservableMultiset<E>

Direct Known Subclasses:
  MultisetBinding, ReadOnlyMultisetProperty

    public abstract class MultisetExpression<E>
    extends java.lang.Object
    implements ObservableMultisetValue<E>

A `SetMultimapExpression` is a `ObservableMultisetValue` plus additional convenience methods to generate bindings.

This class provides identical functionality for `Multiset` as `MapExpression` for `Map`, `SetExpression` for `Set`, or `ListExpression` for `List`.

### Property Summary

All Methods Instance Methods Abstract Methods
`abstract javafx.beans.property.ReadOnlyBooleanProperty` `empty` A boolean property that reflects whether the `Multiset` is empty.
`abstract javafx.beans.property.ReadOnlyIntegerProperty` `size` An integer property that represents the size of the `Multiset`.

### Nested Class Summary

### Nested classes/interfaces inherited from interface com.google.common.collect.Multiset

`Multiset.Entry<E>`

### Constructor Summary

Constructors
Constructor and Description
`MultisetExpression()`

### Method Summary

All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
`boolean` `add(E element)`
`int` `add(E element, int occurrences)`
`boolean` `addAll(java.util.Collection<? extends E> c)`
`javafx.beans.binding.StringBinding` `asString()` Creates a `StringBinding` that holds the value of the `MultisetExpression` turned into a `String`.
`void` `clear()`
`boolean` `contains(java.lang.Object element)`
`boolean` `containsAll(java.util.Collection<?> elements)`
`int` `count(java.lang.Object element)`
`java.util.Set<E>` `elementSet()`
`abstract javafx.beans.property.ReadOnlyBooleanProperty` `emptyProperty()` A boolean property that reflects whether the `Multiset` is empty.
`java.util.Set<Multiset.Entry<E>>` `entrySet()`
`ObservableMultiset<E>` `getValue()`
`boolean` `isEmpty()` Gets the value of the property empty.
`javafx.beans.binding.BooleanBinding` `isEqualTo(ObservableMultiset<?> other)` Creates a new `BooleanBinding` that indicates whether this `ObservableMultiset` is equal to the passed in `ObservableMultiset`.
`javafx.beans.binding.BooleanBinding` `isNotEqualTo(ObservableMultiset<?> other)` Creates a new `BooleanBinding` that indicates whether this `ObservableMultiset` is not equal to the passed in `ObservableMultiset`.
`javafx.beans.binding.BooleanBinding` `isNotNull()` Creates a new `BooleanBinding` that indicates if the wrapped `ObservableMultiset` is not `null`.
`javafx.beans.binding.BooleanBinding` `isNull()` Creates a new `BooleanBinding` that indicates if the wrapped `ObservableMultiset` is `null`.
`java.util.Iterator<E>` `iterator()`
`static <E> MultisetExpression<E>` `multisetExpression(ObservableMultisetValue<E> multisetValue)` Returns a `MultisetExpression` that wraps an `ObservableMultisetValue`.
`boolean` `remove(java.lang.Object element)`
`int` `remove(java.lang.Object element, int occurrences)`
`boolean` `removeAll(java.util.Collection<?> c)`
`boolean` `replaceAll(Multiset<? extends E> multiset)` Replaces all the contents of the `ObservableMultiset` with the contents provided by the given `Multiset`.
`boolean` `retainAll(java.util.Collection<?> c)`
`int` `setCount(E element, int count)`
`boolean` `setCount(E element, int oldCount, int newCount)`
`int` `size()`
`abstract javafx.beans.property.ReadOnlyIntegerProperty` `sizeProperty()` An integer property that represents the size of the `Multiset`.
`java.lang.Object[]` `toArray()`
`<T> T[]` `toArray(T[] a)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface javafx.beans.value.ObservableObjectValue

`get`

### Methods inherited from interface javafx.beans.value.ObservableValue

`addListener, removeListener`

### Methods inherited from interface javafx.beans.Observable

`addListener, removeListener`

### Methods inherited from interface org.eclipse.gef.common.collections.ObservableMultiset

`addListener, removeListener`

### Methods inherited from interface com.google.common.collect.Multiset

`equals, forEach, forEachEntry, hashCode, spliterator, toString`

### Methods inherited from interface java.util.Collection

`parallelStream, removeIf, stream`

### Property Detail

#### empty

    public abstract javafx.beans.property.ReadOnlyBooleanProperty emptyProperty

A boolean property that reflects whether the `Multiset` is empty.

See Also:
  `isEmpty()`

#### size

    public abstract javafx.beans.property.ReadOnlyIntegerProperty sizeProperty

An integer property that represents the size of the `Multiset`.

### Constructor Detail

#### MultisetExpression

    public MultisetExpression()

### Method Detail

#### multisetExpression

    public static <E> MultisetExpression<E> multisetExpression(ObservableMultisetValue<E> multisetValue)

Returns a `MultisetExpression` that wraps an `ObservableMultisetValue`. If the `ObservableMultisetValue` is already a `MultisetExpression`, it will be returned. Otherwise a new concrete `MultisetBinding` is created that is bound to the `ObservableMultisetValue`.

Type Parameters:
  `E` - The element type of the `MultisetExpression`.
Parameters:
  `multisetValue` - The `ObservableMultisetValue` for which to return a `MultisetExpression`.
Returns:
  The passed in `ObservableMultisetValue` if its already a `MultisetExpression`, or a newly created `MultisetBinding` for it.

#### add

    public boolean add(E element)

Specified by:
  `add` in interface `Multiset<E>`
Specified by:
  `add` in interface `java.util.Collection<E>`

#### add

    public int add(E element,
                   int occurrences)

Specified by:
  `add` in interface `Multiset<E>`

#### addAll

    public boolean addAll(java.util.Collection<? extends E> c)

Specified by:
  `addAll` in interface `java.util.Collection<E>`

#### asString

    public javafx.beans.binding.StringBinding asString()

Creates a `StringBinding` that holds the value of the `MultisetExpression` turned into a `String`. If the value of this `SetMultimapExpression` changes, the value of the `StringBinding` will be updated automatically.

Returns:
  A new `StringBinding`.

#### clear

    public void clear()

Specified by:
  `clear` in interface `java.util.Collection<E>`

#### contains

    public boolean contains(java.lang.Object element)

Specified by:
  `contains` in interface `Multiset<E>`
Specified by:
  `contains` in interface `java.util.Collection<E>`

#### containsAll

    public boolean containsAll(java.util.Collection<?> elements)

Specified by:
  `containsAll` in interface `Multiset<E>`
Specified by:
  `containsAll` in interface `java.util.Collection<E>`

#### count

    public int count(java.lang.Object element)

Specified by:
  `count` in interface `Multiset<E>`

#### elementSet

    public java.util.Set<E> elementSet()

Specified by:
  `elementSet` in interface `Multiset<E>`

#### emptyProperty

    public abstract javafx.beans.property.ReadOnlyBooleanProperty emptyProperty()

A boolean property that reflects whether the `Multiset` is empty.

See Also:
  `isEmpty()`

#### entrySet

    public java.util.Set<Multiset.Entry<E>> entrySet()

Specified by:
  `entrySet` in interface `Multiset<E>`

#### getValue

    public ObservableMultiset<E> getValue()

Specified by:
  `getValue` in interface `javafx.beans.value.ObservableValue<ObservableMultiset<E>>`

#### isEmpty

    public boolean isEmpty()

Gets the value of the property empty.

Specified by:
  `isEmpty` in interface `java.util.Collection<E>`
Property description:
  A boolean property that reflects whether the `Multiset` is empty.

#### isEqualTo

    public javafx.beans.binding.BooleanBinding isEqualTo(ObservableMultiset<?> other)

Creates a new `BooleanBinding` that indicates whether this `ObservableMultiset` is equal to the passed in `ObservableMultiset`.

Parameters:
  `other` - The `ObservableMultiset` to compare this `ObservableMultiset` to.
Returns:
  A new `BooleanBinding`.

#### isNotEqualTo

    public javafx.beans.binding.BooleanBinding isNotEqualTo(ObservableMultiset<?> other)

Creates a new `BooleanBinding` that indicates whether this `ObservableMultiset` is not equal to the passed in `ObservableMultiset`.

Parameters:
  `other` - The `ObservableMultiset` to compare this `ObservableMultiset` to.
Returns:
  A new `BooleanBinding`.

#### isNotNull

    public javafx.beans.binding.BooleanBinding isNotNull()

Creates a new `BooleanBinding` that indicates if the wrapped `ObservableMultiset` is not `null`.

Returns:
  A new `BooleanBinding`.

#### isNull

    public javafx.beans.binding.BooleanBinding isNull()

Creates a new `BooleanBinding` that indicates if the wrapped `ObservableMultiset` is `null`.

Returns:
  A new `BooleanBinding`.

#### iterator

    public java.util.Iterator<E> iterator()

Specified by:
  `iterator` in interface `Multiset<E>`
Specified by:
  `iterator` in interface `java.lang.Iterable<E>`
Specified by:
  `iterator` in interface `java.util.Collection<E>`

#### remove

    public boolean remove(java.lang.Object element)

Specified by:
  `remove` in interface `Multiset<E>`
Specified by:
  `remove` in interface `java.util.Collection<E>`

#### remove

    public int remove(java.lang.Object element,
                      int occurrences)

Specified by:
  `remove` in interface `Multiset<E>`

#### removeAll

    public boolean removeAll(java.util.Collection<?> c)

Specified by:
  `removeAll` in interface `Multiset<E>`
Specified by:
  `removeAll` in interface `java.util.Collection<E>`

#### replaceAll

    public boolean replaceAll(Multiset<? extends E> multiset)

Description copied from interface: `ObservableMultiset`
Replaces all the contents of the `ObservableMultiset` with the contents provided by the given `Multiset`.

Specified by:
  `replaceAll` in interface `ObservableMultiset<E>`
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.

#### retainAll

    public boolean retainAll(java.util.Collection<?> c)

Specified by:
  `retainAll` in interface `Multiset<E>`
Specified by:
  `retainAll` in interface `java.util.Collection<E>`

#### setCount

    public int setCount(E element,
                        int count)

Specified by:
  `setCount` in interface `Multiset<E>`

#### setCount

    public boolean setCount(E element,
                            int oldCount,
                            int newCount)

Specified by:
  `setCount` in interface `Multiset<E>`

#### size

    public int size()

Specified by:
  `size` in interface `Multiset<E>`
Specified by:
  `size` in interface `java.util.Collection<E>`

#### sizeProperty

    public abstract javafx.beans.property.ReadOnlyIntegerProperty sizeProperty()

An integer property that represents the size of the `Multiset`.

#### toArray

    public java.lang.Object[] toArray()

Specified by:
  `toArray` in interface `java.util.Collection<E>`

#### toArray

    public <T> T[] toArray(T[] a)

Specified by:
  `toArray` in interface `java.util.Collection<E>`