Class SetMultimapExpression<K,V>
- java.lang.Object
-
- org.eclipse.gef.common.beans.binding.SetMultimapExpression<K,V>
-
- Type Parameters:
K- The key type of theObservableSetMultimap.V- The value type of theObservableSetMultimap.
- 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 java.lang.Object implements ObservableSetMultimapValue<K,V>
ASetMultimapExpressionis aObservableSetMultimapValueplus additional convenience methods to generate bindings.This class provides identical functionality for
SetMultimapasMapExpressionforMap,SetExpressionforSet, orListExpressionforList.
-
-
Constructor Summary
Constructors Constructor Description SetMultimapExpression()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.util.Map<K,java.util.Collection<V>>asMap()javafx.beans.binding.StringBindingasString()voidclear()booleancontainsEntry(java.lang.Object key, java.lang.Object value)booleancontainsKey(java.lang.Object key)booleancontainsValue(java.lang.Object value)abstract javafx.beans.property.ReadOnlyBooleanPropertyemptyProperty()A boolean property that reflects whether theSetMultimapis empty.java.util.Set<java.util.Map.Entry<K,V>>entries()java.util.Set<V>get(K key)ObservableSetMultimap<K,V>getValue()booleanisEmpty()javafx.beans.binding.BooleanBindingisEqualTo(ObservableSetMultimap<?,?> other)Creates a newBooleanBindingthat indicates whether thisObservableSetMultimapis equal to the passed inObservableSetMultimap.javafx.beans.binding.BooleanBindingisNotEqualTo(ObservableSetMultimap<?,?> other)Creates a newBooleanBindingthat indicates whether thisObservableSetMultimapis not equal to the passed inObservableSetMultimap.javafx.beans.binding.BooleanBindingisNotNull()javafx.beans.binding.BooleanBindingisNull()Multiset<K>keys()java.util.Set<K>keySet()booleanput(K key, V value)booleanputAll(Multimap<? extends K,? extends V> multimap)booleanputAll(K key, java.lang.Iterable<? extends V> values)booleanremove(java.lang.Object key, java.lang.Object value)java.util.Set<V>removeAll(java.lang.Object key)booleanreplaceAll(SetMultimap<? extends K,? extends V> setMultimap)Replaces all the contents of theObservableSetMultimapwith the contents provided by the givenSetMultimap.java.util.Set<V>replaceValues(K key, java.lang.Iterable<? extends V> values)static <K,V>
SetMultimapExpression<K,V>setMultimapExpression(ObservableSetMultimapValue<K,V> setMultimapValue)Returns aSetMultimapExpressionthat wraps anObservableSetMultimapValue.intsize()abstract javafx.beans.property.ReadOnlyIntegerPropertysizeProperty()An integer property that represents the size of theSetMultimap.java.util.Collection<V>values()javafx.beans.binding.SetBinding<V>valuesAt(javafx.beans.value.ObservableValue<K> key)Creates a newObjectBindingthat contains the values that are mapped to the specified key.javafx.beans.binding.SetBinding<V>valuesAt(K key)Creates a newObjectBindingthat 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 org.eclipse.gef.common.collections.ObservableSetMultimap
addListener, removeListener
-
Methods inherited from interface com.google.common.collect.SetMultimap
equals
-
-
-
-
Method Detail
-
setMultimapExpression
public static <K,V> SetMultimapExpression<K,V> setMultimapExpression(ObservableSetMultimapValue<K,V> setMultimapValue)
Returns aSetMultimapExpressionthat wraps anObservableSetMultimapValue. If theObservableSetMultimapValueis already aSetMultimapExpression, it will be returned. Otherwise a new concreteSetMultimapBindingis created that is bound to theObservableSetMultimapValue.- Type Parameters:
K- The key type of theSetMultimapExpression.V- The value type of theSetMultimapExpression.- Parameters:
setMultimapValue- TheObservableSetMultimapValuefor which to return aSetMultimapExpression.- Returns:
- The passed in
ObservableSetMultimapValueif its already aSetMultimapExpression, or a newly createdSetMultimapBindingfor it.
-
asString
public javafx.beans.binding.StringBinding asString()
Creates aStringBindingthat holds the value of theSetMultimapExpressionturned into aString. If the value of thisSetMultimapExpressionchanges, the value of theStringBindingwill be updated automatically.- Returns:
- A new
StringBinding.
-
containsEntry
public boolean containsEntry(java.lang.Object key, java.lang.Object value)- Specified by:
containsEntryin interfaceMultimap<K,V>
-
containsKey
public boolean containsKey(java.lang.Object key)
- Specified by:
containsKeyin interfaceMultimap<K,V>
-
containsValue
public boolean containsValue(java.lang.Object value)
- Specified by:
containsValuein interfaceMultimap<K,V>
-
emptyProperty
public abstract javafx.beans.property.ReadOnlyBooleanProperty emptyProperty()
A boolean property that reflects whether theSetMultimapis empty.- Returns:
- A read-only property.
-
getValue
public ObservableSetMultimap<K,V> getValue()
- Specified by:
getValuein interfacejavafx.beans.value.ObservableValue<K>
-
isEqualTo
public javafx.beans.binding.BooleanBinding isEqualTo(ObservableSetMultimap<?,?> other)
Creates a newBooleanBindingthat indicates whether thisObservableSetMultimapis equal to the passed inObservableSetMultimap.- Parameters:
other- TheObservableSetMultimapto compare thisObservableSetMultimapto.- Returns:
- A new
BooleanBinding.
-
isNotEqualTo
public javafx.beans.binding.BooleanBinding isNotEqualTo(ObservableSetMultimap<?,?> other)
Creates a newBooleanBindingthat indicates whether thisObservableSetMultimapis not equal to the passed inObservableSetMultimap.- Parameters:
other- TheObservableSetMultimapto compare thisObservableSetMultimapto.- Returns:
- A new
BooleanBinding.
-
isNotNull
public javafx.beans.binding.BooleanBinding isNotNull()
- Returns:
- A new
BooleanBinding.
-
isNull
public javafx.beans.binding.BooleanBinding isNull()
- Returns:
- A new
BooleanBinding.
-
remove
public boolean remove(java.lang.Object key, java.lang.Object value)
-
removeAll
public java.util.Set<V> removeAll(java.lang.Object key)
-
replaceAll
public boolean replaceAll(SetMultimap<? extends K,? extends V> setMultimap)
Description copied from interface:ObservableSetMultimapReplaces all the contents of theObservableSetMultimapwith the contents provided by the givenSetMultimap.- Specified by:
replaceAllin interfaceObservableSetMultimap<K,V>- Parameters:
setMultimap- TheSetMultimapwhose values should be used to replace those of thisObservableSetMultimap.- Returns:
- Whether this map was changed through the replace operation.
-
replaceValues
public java.util.Set<V> replaceValues(K key, java.lang.Iterable<? extends V> values)
- Specified by:
replaceValuesin interfaceMultimap<K,V>- Specified by:
replaceValuesin interfaceSetMultimap<K,V>
-
sizeProperty
public abstract javafx.beans.property.ReadOnlyIntegerProperty sizeProperty()
An integer property that represents the size of theSetMultimap.- Returns:
- A read-only property.
-
valuesAt
public javafx.beans.binding.SetBinding<V> valuesAt(K key)
Creates a newObjectBindingthat contains the values that are mapped to the specified key.- Parameters:
key- the key of the mapping- Returns:
- A new
SetBinding.
-
-