public class BindingUtils
extends java.lang.Object
Bindings
with functionality related to
Multiset
and SetMultimap
.Constructor and Description |
---|
BindingUtils() |
Modifier and Type | Method and Description |
---|---|
static <E> void |
bindContent(com.google.common.collect.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(com.google.common.collect.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(com.google.common.collect.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(com.google.common.collect.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> javafx.beans.binding.ObjectBinding<java.util.Set<V>> |
valuesAt(ObservableSetMultimap<K,V> setMultimap,
K key)
Creates a new
ObjectBinding that contains the values mapped to
the specified key. |
static <K,V> javafx.beans.binding.ObjectBinding<java.util.Set<V>> |
valuesAt(ObservableSetMultimap<K,V> setMultimap,
javafx.beans.value.ObservableValue<K> key)
Creates a new
ObjectBinding that contains the values mapped to
the specified key. |
public static <E> void bindContent(com.google.common.collect.Multiset<E> source, ObservableMultiset<? extends E> target)
Multiset
to the given target ObservableMultiset
.E
- The element type of the given Multiset
and
ObservableMultiset
.source
- The Multiset
whose content to update when the given
ObservableMultiset
changes.target
- The ObservableMultiset
whose content is to be
observed.public static <K,V> void bindContent(com.google.common.collect.SetMultimap<K,V> source, ObservableSetMultimap<? extends K,? extends V> target)
SetMultimap
to the given target ObservableSetMultimap
.K
- The key type of the given SetMultimap
and
ObservableSetMultimap
.V
- The value type of the given SetMultimap
and
ObservableSetMultimap
.source
- The SetMultimap
whose content to update when the given
ObservableSetMultimap
changes.target
- The ObservableSetMultimap
whose content is to be
observed.public static <E> void bindContentBidirectional(ObservableMultiset<E> source, ObservableMultiset<E> target)
ObservableMultisets
.E
- The element type of the given ObservableMultisets
.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.public static <K,V> void bindContentBidirectional(ObservableSetMultimap<K,V> source, ObservableSetMultimap<K,V> target)
ObservableSetMultimaps
.K
- The key type of the given ObservableSetMultimaps
.V
- The value type of the given ObservableSetMultimaps
.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.public static <E> void unbindContent(com.google.common.collect.Multiset<E> source, ObservableMultiset<? extends E> target)
Multiset
to the given target ObservableMultiset
.E
- The element types of the Multiset
and
ObservableMultiset
.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.public static <K,V> void unbindContent(com.google.common.collect.SetMultimap<K,V> source, ObservableSetMultimap<? extends K,? extends V> target)
SetMultimap
to the given target ObservableSetMultimap
.K
- The key type of the given SetMultimap
and
ObservableSetMultimap
.V
- The value type of the given SetMultimap
and
ObservableSetMultimap
.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.public static <E> void unbindContentBidirectional(ObservableMultiset<E> multiset1, ObservableMultiset<E> multiset2)
ObservableMultisets
. .E
- The element type of the given ObservableMultisets
.multiset1
- The first participant of the bidirectional binding.multiset2
- The second participant of the bidirectional binding.public static <K,V> void unbindContentBidirectional(ObservableSetMultimap<K,V> source, ObservableSetMultimap<K,V> target)
ObservableSetMultimaps
.K
- The key type of the given ObservableSetMultimaps
.V
- The value type of the given ObservableSetMultimaps
.source
- The first participant of the bidirectional binding.target
- The second participant of the bidirectional binding.public static <K,V> javafx.beans.binding.ObjectBinding<java.util.Set<V>> valuesAt(ObservableSetMultimap<K,V> setMultimap, K key)
ObjectBinding
that contains the values mapped to
the specified key.K
- The key type of the ObservableSetMultimap
.V
- The value type of the ObservableSetMultimap
.setMultimap
- The ObservableSetMultimap
from which the values are to
be retrieved.key
- the key of the mappingObjectBinding
.public static <K,V> javafx.beans.binding.ObjectBinding<java.util.Set<V>> valuesAt(ObservableSetMultimap<K,V> setMultimap, javafx.beans.value.ObservableValue<K> key)
ObjectBinding
that contains the values mapped to
the specified key.K
- The key type of the ObservableSetMultimap
.V
- The value type of the ObservableSetMultimap
.setMultimap
- The ObservableSetMultimap
from which the values are to
be retrieved.key
- the key of the mappingObjectBinding
.Copyright (c) 2014 itemis AG and others. All rights reserved.