Package org.eclipse.gef.common.beans.binding

# Class SetMultimapBinding<K,V>

java.lang.Object
org.eclipse.gef.common.beans.binding.SetMultimapExpression<K,V>
org.eclipse.gef.common.beans.binding.SetMultimapBinding<K,V>

Type Parameters:
  `K` - The key type of the `ObservableSetMultimap`.
  `V` - The value type of the `ObservableSetMultimap`.

All Implemented Interfaces:
  `Multimap<K,V>`, `SetMultimap<K,V>`, `Binding<ObservableSetMultimap<K,V>>`, `Observable`, `ObservableObjectValue<ObservableSetMultimap<K,V>>`, `ObservableValue<ObservableSetMultimap<K,V>>`, `ObservableSetMultimapValue<K,V>`, `ObservableSetMultimap<K,V>`

public abstract class SetMultimapBinding<K,V> extends SetMultimapExpression<K,V> implements Binding<ObservableSetMultimap<K,V>>
An abstract base class that provides functionality needed to realize a `Binding` on an `ObservableSetMultimap`.

This class provides identical functionality for `SetMultimap` as `MapBinding` for `Map`, `SetBinding` for `Set`, or `ListBinding` for `List`.

## Property Summary

Properties
Type
Property
Description
`ReadOnlyBooleanProperty`
`empty`
A boolean property that reflects whether the `SetMultimap` is empty.
`ReadOnlyIntegerProperty`
`size`
An integer property that represents the size of the `SetMultimap`.

## Constructor Summary

Constructors
Constructor
Description
`SetMultimapBinding()`

## Method Summary

Modifier and Type
Method
Description
`void`
`addListener(InvalidationListener listener)`
`void`
`addListener(ChangeListener<? super ObservableSetMultimap<K,V>> listener)`
`void`
`addListener(SetMultimapChangeListener<? super K,? super V> listener)`
Adds a `SetMultimapChangeListener` to this `ObservableSetMultimap`.
`protected void`
`bind(Observable... dependencies)`
Start observing the given dependencies for changes.
`protected abstract ObservableSetMultimap<K,V>`
`computeValue()`
Computes the current value of this `SetMultimapBinding`.
`void`
`dispose()`
`ReadOnlyBooleanProperty`
`emptyProperty()`
A boolean property that reflects whether the `SetMultimap` is empty.
`protected void`
`fireValueChangedEvent()`
Fires notifications to all attached `InvalidationListeners`, `ChangeListeners`, and `SetMultimapChangeListeners`.
`protected void`
`fireValueChangedEvent(SetMultimapChangeListener.Change<? extends K,? extends V> change)`
Fires notifications to all attached `InvalidationListeners`, `ChangeListeners`, and `SetMultimapChangeListeners`.
`ObservableSetMultimap<K,V>`
`get()`
`ObservableList<?>`
`getDependencies()`
`void`
`invalidate()`
`protected void`
`invalidated()`
Can be overwritten by subclasses to receive invalidation notifications.
`boolean`
`isValid()`
`void`
`removeListener(InvalidationListener listener)`
`void`
`removeListener(ChangeListener<? super ObservableSetMultimap<K,V>> listener)`
`void`
`removeListener(SetMultimapChangeListener<? super K,? super V> listener)`
Removes a `SetMultimapChangeListener` from this `ObservableSetMultimap`.
`ReadOnlyIntegerProperty`
`sizeProperty()`
An integer property that represents the size of the `SetMultimap`.
`protected void`
`unbind(Observable... dependencies)`
Stops observing the dependencies for changes.

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

`asMap, asString, clear, containsEntry, containsKey, containsValue, entries, get, getValue, isEmpty, isEqualTo, isNotEqualTo, isNotNull, isNull, keys, keySet, put, putAll, putAll, remove, removeAll, replaceAll, replaceValues, setMultimapExpression, size, values, valuesAt, valuesAt`

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

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

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

`forEach, hashCode`

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

`getValue`

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

`equals`

## Property Details

### empty

public ReadOnlyBooleanProperty emptyProperty

Specified by:
  `emptyProperty` in class `SetMultimapExpression<K,V>`
Returns:
  A read-only property.

### size

public ReadOnlyIntegerProperty sizeProperty

Specified by:
  `sizeProperty` in class `SetMultimapExpression<K,V>`
Returns:
  A read-only property.

## Constructor Details

### SetMultimapBinding

public SetMultimapBinding()

## Method Details

### addListener

public void addListener(ChangeListener<? super ObservableSetMultimap<K,V>> listener)

Specified by:
  `addListener` in interface `ObservableValue<K>`

### addListener

public void addListener(InvalidationListener listener)

Specified by:
  `addListener` in interface `Observable`

### addListener

public void addListener(SetMultimapChangeListener<? super K,? super V> listener)
Description copied from interface: `ObservableSetMultimap`
Adds a `SetMultimapChangeListener` to this `ObservableSetMultimap`. If the same listener is registered more than once, it will be notified more than once.

Specified by:
  `addListener` in interface `ObservableSetMultimap<K,V>`
Parameters:
  `listener` - The `SetMultimapChangeListener` to add.

### bind

protected void bind(Observable... dependencies)
Start observing the given dependencies for changes. If the value of one of the dependencies changes, the binding is marked as invalid.

Parameters:
  `dependencies` - The dependencies to observe.

### computeValue

protected abstract ObservableSetMultimap<K,V> computeValue()
Computes the current value of this `SetMultimapBinding`.

Returns:
  The current value of this `SetMultimapBinding`.

### dispose

public void dispose()

Specified by:
  `dispose` in interface `Binding<K>`

### emptyProperty

public ReadOnlyBooleanProperty emptyProperty()
Description copied from class: `SetMultimapExpression`
A boolean property that reflects whether the `SetMultimap` is empty.

Specified by:
  `emptyProperty` in class `SetMultimapExpression<K,V>`
Returns:
  A read-only property.

### fireValueChangedEvent

protected void fireValueChangedEvent()
Fires notifications to all attached `InvalidationListeners`, `ChangeListeners`, and `SetMultimapChangeListeners`.

### fireValueChangedEvent

protected void fireValueChangedEvent(SetMultimapChangeListener.Change<? extends K,? extends V> change)
Fires notifications to all attached `InvalidationListeners`, `ChangeListeners`, and `SetMultimapChangeListeners`.

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

### get

public ObservableSetMultimap<K,V> get()

Specified by:
  `get` in interface `ObservableObjectValue<K>`

### getDependencies

public ObservableList<?> getDependencies()

Specified by:
  `getDependencies` in interface `Binding<K>`

### invalidate

public void invalidate()

Specified by:
  `invalidate` in interface `Binding<K>`

### invalidated

protected void invalidated()
Can be overwritten by subclasses to receive invalidation notifications. Does nothing by default.

### isValid

public boolean isValid()

Specified by:
  `isValid` in interface `Binding<K>`

### removeListener

public void removeListener(ChangeListener<? super ObservableSetMultimap<K,V>> listener)

Specified by:
  `removeListener` in interface `ObservableValue<K>`

### removeListener

public void removeListener(InvalidationListener listener)

Specified by:
  `removeListener` in interface `Observable`

### removeListener

public void removeListener(SetMultimapChangeListener<? super K,? super V> listener)
Description copied from interface: `ObservableSetMultimap`
Removes a `SetMultimapChangeListener` from this `ObservableSetMultimap`. Will do nothing if the listener was not attached to this `ObservableSetMultimap`. If it was added more than once, then only the first occurrence will be removed.

Specified by:
  `removeListener` in interface `ObservableSetMultimap<K,V>`
Parameters:
  `listener` - The `SetMultimapChangeListener` to remove.

### sizeProperty

public ReadOnlyIntegerProperty sizeProperty()
Description copied from class: `SetMultimapExpression`
An integer property that represents the size of the `SetMultimap`.

Specified by:
  `sizeProperty` in class `SetMultimapExpression<K,V>`
Returns:
  A read-only property.

### unbind

protected void unbind(Observable... dependencies)
Stops observing the dependencies for changes. The binding will no longer be marked as invalid if one of the dependencies changes.

Parameters:
  `dependencies` - The dependencies to stop observing.