org.eclipse.gef.common.beans.property

## Class MultisetPropertyBase<E>

- java.lang.Object
- - org.eclipse.gef.common.beans.binding.MultisetExpression<E>
  - - org.eclipse.gef.common.beans.property.ReadOnlyMultisetProperty<E>
    - - org.eclipse.gef.common.beans.property.MultisetProperty<E>
      - - org.eclipse.gef.common.beans.property.MultisetPropertyBase<E>

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

All Implemented Interfaces:
  com.google.common.collect.Multiset<E>, Iterable<E>, Collection<E>, Observable, Property<ObservableMultiset<E>>, ReadOnlyProperty<ObservableMultiset<E>>, ObservableObjectValue<ObservableMultiset<E>>, ObservableValue<ObservableMultiset<E>>, WritableObjectValue<ObservableMultiset<E>>, WritableValue<ObservableMultiset<E>>, ObservableMultisetValue<E>, WritableMultisetValue<E>, ObservableMultiset<E>

Direct Known Subclasses:
  SimpleMultisetProperty

    public abstract class MultisetPropertyBase<E>
    extends MultisetProperty<E>

Abstract base class for implementing a `Property` wrapping an `ObservableMultiset`.

This class provides identical functionality for `Multiset` as `MapPropertyBase` for `Map`, `SetPropertyBase` for `Set`, or `ListPropertyBase` for `List`.

### Property Summary

All Methods Instance Methods Concrete Methods
`ReadOnlyBooleanProperty` `empty` A boolean property that reflects whether the `Multiset` is empty.
`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

`com.google.common.collect.Multiset.Entry<E>`

### Constructor Summary

Constructors
Constructor and Description
`MultisetPropertyBase()` Creates a new `MultisetPropertyBase` with no initial value.
`MultisetPropertyBase(ObservableMultiset<E> initialValue)` Creates a new `MultisetPropertyBase` with the given `ObservableMultiset` as initial value.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addListener(ChangeListener<? super ObservableMultiset<E>> listener)`
`void` `addListener(InvalidationListener listener)`
`void` `addListener(MultisetChangeListener<? super E> listener)` Adds a `MultisetChangeListener` to this `ObservableMultiset`.
`protected void` `appendValueToString(StringBuilder result)` Appends a representation of this `SetMultimapProperty`'s value to the given `StringBuilder`.
`void` `bind(ObservableValue<? extends ObservableMultiset<E>> observedValue)`
`ReadOnlyBooleanProperty` `emptyProperty()` A boolean property that reflects whether the `Multiset` is empty.
`protected void` `fireValueChangedEvent()` Fires notifications to all attached `InvalidationListeners`, `ChangeListeners`, and `MultisetChangeListeners`.
`protected void` `fireValueChangedEvent(MultisetChangeListener.Change<? extends E> change)` Fires notifications to all attached `InvalidationListeners`, `ChangeListeners`, and `MultisetChangeListeners`.
`ObservableMultiset<E>` `get()`
`protected void` `invalidated()` Can be overwritten by subclasses to receive invalidation notifications.
`boolean` `isBound()`
`void` `removeListener(ChangeListener<? super ObservableMultiset<E>> listener)`
`void` `removeListener(InvalidationListener listener)`
`void` `removeListener(MultisetChangeListener<? super E> listener)` Removes a `MultisetChangeListener` from this `ObservableMultiset`.
`void` `set(ObservableMultiset<E> newValue)`
`ReadOnlyIntegerProperty` `sizeProperty()` An integer property that represents the size of the `Multiset`.
`void` `unbind()`

### Methods inherited from class org.eclipse.gef.common.beans.property.MultisetProperty

`bindBidirectional, setValue, unbindBidirectional`

### Methods inherited from class org.eclipse.gef.common.beans.property.ReadOnlyMultisetProperty

`bindContent, bindContentBidirectional, equals, hashCode, toString, unbindContent, unbindContentBidirectional`

### Methods inherited from class org.eclipse.gef.common.beans.binding.MultisetExpression

`add, add, addAll, asString, clear, contains, containsAll, count, elementSet, entrySet, getValue, isEmpty, isEqualTo, isNotEqualTo, isNotNull, isNull, iterator, multisetExpression, remove, remove, removeAll, replaceAll, retainAll, setCount, setCount, size, toArray, toArray`

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

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface javafx.beans.property.ReadOnlyProperty

`getBean, getName`

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

`getValue`

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

`getValue`

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

`replaceAll`

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

`add, add, contains, containsAll, count, elementSet, entrySet, equals, hashCode, iterator, remove, remove, removeAll, retainAll, setCount, setCount, toString`

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

`addAll, clear, isEmpty, parallelStream, removeIf, size, spliterator, stream, toArray, toArray`

### Methods inherited from interface java.lang.Iterable

`forEach`

### Property Detail

#### empty

    public ReadOnlyBooleanProperty emptyProperty

Specified by:
  `emptyProperty` in class `MultisetExpression<E>`
See Also:
  `MultisetExpression.isEmpty()`

#### size

    public ReadOnlyIntegerProperty sizeProperty

Specified by:
  `sizeProperty` in class `MultisetExpression<E>`

### Constructor Detail

#### MultisetPropertyBase

    public MultisetPropertyBase()

Creates a new `MultisetPropertyBase` with no initial value.

#### MultisetPropertyBase

    public MultisetPropertyBase(ObservableMultiset<E> initialValue)

Creates a new `MultisetPropertyBase` with the given `ObservableMultiset` as initial value.

Parameters:
  `initialValue` - The initial value of the to be created `MultisetPropertyBase`.

### Method Detail

#### addListener

    public void addListener(ChangeListener<? super ObservableMultiset<E>> listener)

#### addListener

    public void addListener(InvalidationListener listener)

#### addListener

    public void addListener(MultisetChangeListener<? super E> listener)

Description copied from interface: `ObservableMultiset`
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.

#### appendValueToString

    protected void appendValueToString(StringBuilder result)

Description copied from class: `ReadOnlyMultisetProperty`
Appends a representation of this `SetMultimapProperty`'s value to the given `StringBuilder`. Gets called from `ReadOnlyMultisetProperty.toString()` to allow subclasses to provide a changed value representation.

Overrides:
  `appendValueToString` in class `ReadOnlyMultisetProperty<E>`
Parameters:
  `result` - A `StringBuilder` to append the value representation to.

#### bind

    public void bind(ObservableValue<? extends ObservableMultiset<E>> observedValue)

#### emptyProperty

    public ReadOnlyBooleanProperty emptyProperty()

Description copied from class: `MultisetExpression`
A boolean property that reflects whether the `Multiset` is empty.

Specified by:
  `emptyProperty` in class `MultisetExpression<E>`
See Also:
  `MultisetExpression.isEmpty()`

#### fireValueChangedEvent

    protected void fireValueChangedEvent()

Fires notifications to all attached `InvalidationListeners`, `ChangeListeners`, and `MultisetChangeListeners`.

#### fireValueChangedEvent

    protected void fireValueChangedEvent(MultisetChangeListener.Change<? extends E> change)

Fires notifications to all attached `InvalidationListeners`, `ChangeListeners`, and `MultisetChangeListeners`.

Parameters:
  `change` - the change that needs to be propagated

#### get

    public ObservableMultiset<E> get()

#### invalidated

    protected void invalidated()

Can be overwritten by subclasses to receive invalidation notifications. Does nothing by default.

#### isBound

    public boolean isBound()

#### removeListener

    public void removeListener(ChangeListener<? super ObservableMultiset<E>> listener)

#### removeListener

    public void removeListener(InvalidationListener listener)

#### removeListener

    public void removeListener(MultisetChangeListener<? super E> listener)

Description copied from interface: `ObservableMultiset`
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.

#### set

    public void set(ObservableMultiset<E> newValue)

#### sizeProperty

    public ReadOnlyIntegerProperty sizeProperty()

Description copied from class: `MultisetExpression`
An integer property that represents the size of the `Multiset`.

Specified by:
  `sizeProperty` in class `MultisetExpression<E>`

#### unbind

    public void unbind()