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

# Class BindingUtils

java.lang.Object
org.eclipse.gef.common.beans.binding.BindingUtils

public class BindingUtils extends Object
A utility class that augments `Bindings` with functionality related to `Multiset` and `SetMultimap`.

## Constructor Summary

Constructors
Constructor
Description
`BindingUtils()`

## Method Summary

Modifier and Type
Method
Description
`static <E> void`
`bindContent(Multiset<E> source, ObservableMultiset<? extends E> target)`
Creates a unidirectional content binding from the given source `Multiset` to the given target `ObservableMultiset`.
`static <K, V> void`
`bindContent(SetMultimap<K,V> source, ObservableSetMultimap<? extends K,? extends V> target)`
Creates a unidirectional content binding from the given source `SetMultimap` to the given target `ObservableSetMultimap`.
`static <E> void`
`bindContentBidirectional(ObservableMultiset<E> source, ObservableMultiset<E> target)`
Creates a bidirectional content binding between the given `ObservableMultisets`.
`static <K, V> void`
`bindContentBidirectional(ObservableSetMultimap<K,V> source, ObservableSetMultimap<K,V> target)`
Creates a unidirectional content binding between the given `ObservableSetMultimaps`.
`static <E> void`
`unbindContent(Multiset<E> source, ObservableMultiset<? extends E> target)`
Removes an existing content binding from the given source `Multiset` to the given target `ObservableMultiset`.
`static <K, V> void`
`unbindContent(SetMultimap<K,V> source, ObservableSetMultimap<? extends K,? extends V> target)`
Removes an existing unidirectional content binding from the given source `SetMultimap` to the given target `ObservableSetMultimap`.
`static <E> void`
`unbindContentBidirectional(ObservableMultiset<E> multiset1, ObservableMultiset<E> multiset2)`
Removes a bidirectional content binding between the given `ObservableMultisets`. .
`static <K, V> void`
`unbindContentBidirectional(ObservableSetMultimap<K,V> source, ObservableSetMultimap<K,V> target)`
Removes a bidirectional content binding between the given `ObservableSetMultimaps`.
`static <K, V> SetBinding<V>`
`valuesAt(ObservableSetMultimap<K,V> setMultimap, ObservableValue<K> key)`
Creates a new `ObjectBinding` that contains the values mapped to the specified key.
`static <K, V> SetBinding<V>`
`valuesAt(ObservableSetMultimap<K,V> setMultimap, K key)`
Creates a new `ObjectBinding` that contains the values mapped to the specified key.

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

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

## Constructor Details

### BindingUtils

public BindingUtils()

## Method Details

### bindContent

public static <E> void bindContent(Multiset<E> source, ObservableMultiset<? extends E> target)
Creates a unidirectional content binding from the given source `Multiset` to the given target `ObservableMultiset`.

Type Parameters:
  `E` - The element type of the given `Multiset` and `ObservableMultiset`.
Parameters:
  `source` - The `Multiset` whose content to update when the given `ObservableMultiset` changes.
  `target` - The `ObservableMultiset` whose content is to be observed.

### bindContent

public static <K, V> void bindContent(SetMultimap<K,V> source, ObservableSetMultimap<? extends K,? extends V> target)
Creates a unidirectional content binding from the given source `SetMultimap` to the given target `ObservableSetMultimap`.

Type Parameters:
  `K` - The key type of the given `SetMultimap` and `ObservableSetMultimap`.
  `V` - The value type of the given `SetMultimap` and `ObservableSetMultimap`.
Parameters:
  `source` - The `SetMultimap` whose content to update when the given `ObservableSetMultimap` changes.
  `target` - The `ObservableSetMultimap` whose content is to be observed.

### bindContentBidirectional

public static <E> void bindContentBidirectional(ObservableMultiset<E> source, ObservableMultiset<E> target)
Creates a bidirectional content binding between the given `ObservableMultisets`.

Type Parameters:
  `E` - The element type of the given `ObservableMultisets`.
Parameters:
  `source` - The first participant of the bidirectional binding. Its contents will be initially replaced with that of the second participant before both are synchronized.
  `target` - The second participant of the bidirectional binding. Its contents will be initially taken to update the contents of the first participant before both are synchronized.

### bindContentBidirectional

public static <K, V> void bindContentBidirectional(ObservableSetMultimap<K,V> source, ObservableSetMultimap<K,V> target)
Creates a unidirectional content binding between the given `ObservableSetMultimaps`.

Type Parameters:
  `K` - The key type of the given `ObservableSetMultimaps`.
  `V` - The value type of the given `ObservableSetMultimaps`.
Parameters:
  `source` - The first participant of the bidirectional binding. Its contents will be initially replaced with that of the second participant before both are synchronized.
  `target` - The second participant of the bidirectional binding. Its contents will be initially taken to update the contents of the first participant before both are synchronized.

### unbindContent

public static <E> void unbindContent(Multiset<E> source, ObservableMultiset<? extends E> target)
Removes an existing content binding from the given source `Multiset` to the given target `ObservableMultiset`.

Type Parameters:
  `E` - The element types of the `Multiset` and `ObservableMultiset`.
Parameters:
  `source` - The `Multiset` whose content should no longer be updated when the given `ObservableMultiset` changes.
  `target` - The `ObservableMultiset` whose content is no longer to be observed.

### unbindContent

public static <K, V> void unbindContent(SetMultimap<K,V> source, ObservableSetMultimap<? extends K,? extends V> target)
Removes an existing unidirectional content binding from the given source `SetMultimap` to the given target `ObservableSetMultimap`.

Type Parameters:
  `K` - The key type of the given `SetMultimap` and `ObservableSetMultimap`.
  `V` - The value type of the given `SetMultimap` and `ObservableSetMultimap`.
Parameters:
  `source` - The `SetMultimap` whose content is no longer to update when the given `ObservableSetMultimap` changes.
  `target` - The `ObservableSetMultimap` whose content is no longer to be observed.

### unbindContentBidirectional

public static <E> void unbindContentBidirectional(ObservableMultiset<E> multiset1, ObservableMultiset<E> multiset2)
Removes a bidirectional content binding between the given `ObservableMultisets`. .

Type Parameters:
  `E` - The element type of the given `ObservableMultisets`.
Parameters:
  `multiset1` - The first participant of the bidirectional binding.
  `multiset2` - The second participant of the bidirectional binding.

### unbindContentBidirectional

public static <K, V> void unbindContentBidirectional(ObservableSetMultimap<K,V> source, ObservableSetMultimap<K,V> target)
Removes a bidirectional content binding between the given `ObservableSetMultimaps`.

Type Parameters:
  `K` - The key type of the given `ObservableSetMultimaps`.
  `V` - The value type of the given `ObservableSetMultimaps`.
Parameters:
  `source` - The first participant of the bidirectional binding.
  `target` - The second participant of the bidirectional binding.

### valuesAt

public static <K, V> SetBinding<V> valuesAt(ObservableSetMultimap<K,V> setMultimap, K key)
Creates a new `ObjectBinding` that contains the values mapped to the specified key.

Type Parameters:
  `K` - The key type of the `ObservableSetMultimap`.
  `V` - The value type of the `ObservableSetMultimap`.
Parameters:
  `setMultimap` - The `ObservableSetMultimap` from which the values are to be retrieved.
  `key` - the key of the mapping
Returns:
  A new `ObjectBinding`.

### valuesAt

public static <K, V> SetBinding<V> valuesAt(ObservableSetMultimap<K,V> setMultimap, ObservableValue<K> key)
Creates a new `ObjectBinding` that contains the values mapped to the specified key.

Type Parameters:
  `K` - The key type of the `ObservableSetMultimap`.
  `V` - The value type of the `ObservableSetMultimap`.
Parameters:
  `setMultimap` - The `ObservableSetMultimap` from which the values are to be retrieved.
  `key` - the key of the mapping
Returns:
  A new `ObjectBinding`.