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

# Class SetMultimapExpression<K,V>

java.lang.Object
org.eclipse.gef.common.beans.binding.SetMultimapExpression<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>`, `javafx.beans.Observable`, `javafx.beans.value.ObservableObjectValue<ObservableSetMultimap<K,V>>`, `javafx.beans.value.ObservableValue<ObservableSetMultimap<K,V>>`, `ObservableSetMultimapValue<K,V>`, `ObservableSetMultimap<K,V>`

Direct Known Subclasses:
  `ReadOnlySetMultimapProperty`, `SetMultimapBinding`

public abstract class SetMultimapExpression<K,V> extends Object implements ObservableSetMultimapValue<K,V>
A `SetMultimapExpression` is a `ObservableSetMultimapValue` plus additional convenience methods to generate bindings.

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

## Property Summary

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

## Constructor Summary

Constructors
Constructor
Description
`SetMultimapExpression()`

## Method Summary

Modifier and Type
Method
Description
`Map<K,Collection<V>>`
`asMap()`
`javafx.beans.binding.StringBinding`
`asString()`
Creates a `StringBinding` that holds the value of the `SetMultimapExpression` turned into a `String`.
`void`
`clear()`
`boolean`
`containsEntry(Object key, Object value)`
`boolean`
`containsKey(Object key)`
`boolean`
`containsValue(Object value)`
`abstract javafx.beans.property.ReadOnlyBooleanProperty`
`emptyProperty()`
A boolean property that reflects whether the `SetMultimap` is empty.
`Set<Map.Entry<K,V>>`
`entries()`
`Set<V>`
`get(K key)`
`ObservableSetMultimap<K,V>`
`getValue()`
`boolean`
`isEmpty()`
Gets the value of the property empty.
`javafx.beans.binding.BooleanBinding`
`isEqualTo(ObservableSetMultimap<?,?> other)`
Creates a new `BooleanBinding` that indicates whether this `ObservableSetMultimap` is equal to the passed in `ObservableSetMultimap`.
`javafx.beans.binding.BooleanBinding`
`isNotEqualTo(ObservableSetMultimap<?,?> other)`
Creates a new `BooleanBinding` that indicates whether this `ObservableSetMultimap` is not equal to the passed in `ObservableSetMultimap`.
`javafx.beans.binding.BooleanBinding`
`isNotNull()`
Creates a new `BooleanBinding` that indicates if the wrapped `ObservableSetMultimap` is not `null`.
`javafx.beans.binding.BooleanBinding`
`isNull()`
Creates a new `BooleanBinding` that indicates if the wrapped `ObservableSetMultimap` is `null`.
`Multiset<K>`
`keys()`
`Set<K>`
`keySet()`
`boolean`
`put(K key, V value)`
`boolean`
`putAll(Multimap<? extends K,? extends V> multimap)`
`boolean`
`putAll(K key, Iterable<? extends V> values)`
`boolean`
`remove(Object key, Object value)`
`Set<V>`
`removeAll(Object key)`
`boolean`
`replaceAll(SetMultimap<? extends K,? extends V> setMultimap)`
Replaces all the contents of the `ObservableSetMultimap` with the contents provided by the given `SetMultimap`.
`Set<V>`
`replaceValues(K key, Iterable<? extends V> values)`
`static <K, V> SetMultimapExpression<K,V>`
`setMultimapExpression(ObservableSetMultimapValue<K,V> setMultimapValue)`
Returns a `SetMultimapExpression` that wraps an `ObservableSetMultimapValue`.
`int`
`size()`
`abstract javafx.beans.property.ReadOnlyIntegerProperty`
`sizeProperty()`
An integer property that represents the size of the `SetMultimap`.
`Collection<V>`
`values()`
`javafx.beans.binding.SetBinding<V>`
`valuesAt(javafx.beans.value.ObservableValue<K> key)`
Creates a new `ObjectBinding` that contains the values that are mapped to the specified key.
`javafx.beans.binding.SetBinding<V>`
`valuesAt(K key)`
Creates a new `ObjectBinding` that contains the values that are mapped to the specified key.

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

`addListener, removeListener`

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

`get`

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

`addListener, removeListener`

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

`addListener, removeListener`

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

`equals`

## Property Details

### empty

public abstract javafx.beans.property.ReadOnlyBooleanProperty emptyProperty
A boolean property that reflects whether the `SetMultimap` is empty.

See Also:
  - `isEmpty()`

### size

public abstract javafx.beans.property.ReadOnlyIntegerProperty sizeProperty
An integer property that represents the size of the `SetMultimap`.

## Constructor Details

### SetMultimapExpression

public SetMultimapExpression()

## Method Details

### setMultimapExpression

public static <K, V> SetMultimapExpression<K,V> setMultimapExpression(ObservableSetMultimapValue<K,V> setMultimapValue)
Returns a `SetMultimapExpression` that wraps an `ObservableSetMultimapValue`. If the `ObservableSetMultimapValue` is already a `SetMultimapExpression`, it will be returned. Otherwise a new concrete `SetMultimapBinding` is created that is bound to the `ObservableSetMultimapValue`.

Type Parameters:
  `K` - The key type of the `SetMultimapExpression`.
  `V` - The value type of the `SetMultimapExpression`.
Parameters:
  `setMultimapValue` - The `ObservableSetMultimapValue` for which to return a `SetMultimapExpression`.
Returns:
  The passed in `ObservableSetMultimapValue` if its already a `SetMultimapExpression`, or a newly created `SetMultimapBinding` for it.

### asMap

public Map<K,Collection<V>> asMap()

Specified by:
  `asMap` in interface `Multimap<K,V>`
Specified by:
  `asMap` in interface `SetMultimap<K,V>`

### asString

public javafx.beans.binding.StringBinding asString()
Creates a `StringBinding` that holds the value of the `SetMultimapExpression` 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 `Multimap<K,V>`

### containsEntry

public boolean containsEntry(Object key, Object value)

Specified by:
  `containsEntry` in interface `Multimap<K,V>`

### containsKey

public boolean containsKey(Object key)

Specified by:
  `containsKey` in interface `Multimap<K,V>`

### containsValue

public boolean containsValue(Object value)

Specified by:
  `containsValue` in interface `Multimap<K,V>`

### emptyProperty

public abstract javafx.beans.property.ReadOnlyBooleanProperty emptyProperty()
A boolean property that reflects whether the `SetMultimap` is empty.

See Also:
  - `isEmpty()`

### entries

public Set<Map.Entry<K,V>> entries()

Specified by:
  `entries` in interface `Multimap<K,V>`
Specified by:
  `entries` in interface `SetMultimap<K,V>`

### get

public Set<V> get(K key)

Specified by:
  `get` in interface `Multimap<K,V>`
Specified by:
  `get` in interface `SetMultimap<K,V>`

### getValue

public ObservableSetMultimap<K,V> getValue()

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

### isEmpty

public boolean isEmpty()
Gets the value of the property empty.

Specified by:
  `isEmpty` in interface `Multimap<K,V>`
Property description:
  A boolean property that reflects whether the `SetMultimap` is empty.

### isEqualTo

public javafx.beans.binding.BooleanBinding isEqualTo(ObservableSetMultimap<?,?> other)
Creates a new `BooleanBinding` that indicates whether this `ObservableSetMultimap` is equal to the passed in `ObservableSetMultimap`.

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

### isNotEqualTo

public javafx.beans.binding.BooleanBinding isNotEqualTo(ObservableSetMultimap<?,?> other)
Creates a new `BooleanBinding` that indicates whether this `ObservableSetMultimap` is not equal to the passed in `ObservableSetMultimap`.

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

### isNotNull

public javafx.beans.binding.BooleanBinding isNotNull()
Creates a new `BooleanBinding` that indicates if the wrapped `ObservableSetMultimap` is not `null`.

Returns:
  A new `BooleanBinding`.

### isNull

public javafx.beans.binding.BooleanBinding isNull()
Creates a new `BooleanBinding` that indicates if the wrapped `ObservableSetMultimap` is `null`.

Returns:
  A new `BooleanBinding`.

### keys

public Multiset<K> keys()

Specified by:
  `keys` in interface `Multimap<K,V>`

### keySet

public Set<K> keySet()

Specified by:
  `keySet` in interface `Multimap<K,V>`

### put

public boolean put(K key, V value)

Specified by:
  `put` in interface `Multimap<K,V>`

### putAll

public boolean putAll(K key, Iterable<? extends V> values)

Specified by:
  `putAll` in interface `Multimap<K,V>`

### putAll

public boolean putAll(Multimap<? extends K,? extends V> multimap)

Specified by:
  `putAll` in interface `Multimap<K,V>`

### remove

public boolean remove(Object key, Object value)

Specified by:
  `remove` in interface `Multimap<K,V>`

### removeAll

public Set<V> removeAll(Object key)

Specified by:
  `removeAll` in interface `Multimap<K,V>`
Specified by:
  `removeAll` in interface `SetMultimap<K,V>`

### replaceAll

public boolean replaceAll(SetMultimap<? extends K,? extends V> setMultimap)
Description copied from interface: `ObservableSetMultimap`
Replaces all the contents of the `ObservableSetMultimap` with the contents provided by the given `SetMultimap`.

Specified by:
  `replaceAll` in interface `ObservableSetMultimap<K,V>`
Parameters:
  `setMultimap` - The `SetMultimap` whose values should be used to replace those of this `ObservableSetMultimap`.
Returns:
  Whether this map was changed through the replace operation.

### replaceValues

public Set<V> replaceValues(K key, Iterable<? extends V> values)

Specified by:
  `replaceValues` in interface `Multimap<K,V>`
Specified by:
  `replaceValues` in interface `SetMultimap<K,V>`

### size

public int size()

Specified by:
  `size` in interface `Multimap<K,V>`

### sizeProperty

public abstract javafx.beans.property.ReadOnlyIntegerProperty sizeProperty()
An integer property that represents the size of the `SetMultimap`.

### values

public Collection<V> values()

Specified by:
  `values` in interface `Multimap<K,V>`

### valuesAt

public javafx.beans.binding.SetBinding<V> valuesAt(K key)
Creates a new `ObjectBinding` that contains the values that are mapped to the specified key.

Parameters:
  `key` - the key of the mapping
Returns:
  A new `SetBinding`.

### valuesAt

public javafx.beans.binding.SetBinding<V> valuesAt(javafx.beans.value.ObservableValue<K> key)
Creates a new `ObjectBinding` that contains the values that are mapped to the specified key.

Parameters:
  `key` - The key of the mapping.
Returns:
  The `ObjectBinding`.