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>
ASetMultimapExpression
is aObservableSetMultimapValue
plus additional convenience methods to generate bindings.This class provides identical functionality for
SetMultimap
asMapExpression
forMap
,SetExpression
forSet
, orListExpression
forList
.
-
-
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.StringBinding
asString()
void
clear()
boolean
containsEntry(java.lang.Object key, java.lang.Object value)
boolean
containsKey(java.lang.Object key)
boolean
containsValue(java.lang.Object value)
abstract javafx.beans.property.ReadOnlyBooleanProperty
emptyProperty()
A boolean property that reflects whether theSetMultimap
is empty.java.util.Set<java.util.Map.Entry<K,V>>
entries()
java.util.Set<V>
get(K key)
ObservableSetMultimap<K,V>
getValue()
boolean
isEmpty()
javafx.beans.binding.BooleanBinding
isEqualTo(ObservableSetMultimap<?,?> other)
Creates a newBooleanBinding
that indicates whether thisObservableSetMultimap
is equal to the passed inObservableSetMultimap
.javafx.beans.binding.BooleanBinding
isNotEqualTo(ObservableSetMultimap<?,?> other)
Creates a newBooleanBinding
that indicates whether thisObservableSetMultimap
is not equal to the passed inObservableSetMultimap
.javafx.beans.binding.BooleanBinding
isNotNull()
javafx.beans.binding.BooleanBinding
isNull()
Multiset<K>
keys()
java.util.Set<K>
keySet()
boolean
put(K key, V value)
boolean
putAll(Multimap<? extends K,? extends V> multimap)
boolean
putAll(K key, java.lang.Iterable<? extends V> values)
boolean
remove(java.lang.Object key, java.lang.Object value)
java.util.Set<V>
removeAll(java.lang.Object key)
boolean
replaceAll(SetMultimap<? extends K,? extends V> setMultimap)
Replaces all the contents of theObservableSetMultimap
with 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 aSetMultimapExpression
that wraps anObservableSetMultimapValue
.int
size()
abstract javafx.beans.property.ReadOnlyIntegerProperty
sizeProperty()
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 newObjectBinding
that contains the values that are mapped to the specified key.javafx.beans.binding.SetBinding<V>
valuesAt(K key)
Creates a newObjectBinding
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 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 aSetMultimapExpression
that wraps anObservableSetMultimapValue
. If theObservableSetMultimapValue
is already aSetMultimapExpression
, it will be returned. Otherwise a new concreteSetMultimapBinding
is created that is bound to theObservableSetMultimapValue
.- Type Parameters:
K
- The key type of theSetMultimapExpression
.V
- The value type of theSetMultimapExpression
.- Parameters:
setMultimapValue
- TheObservableSetMultimapValue
for which to return aSetMultimapExpression
.- Returns:
- The passed in
ObservableSetMultimapValue
if its already aSetMultimapExpression
, or a newly createdSetMultimapBinding
for it.
-
asString
public javafx.beans.binding.StringBinding asString()
Creates aStringBinding
that holds the value of theSetMultimapExpression
turned into aString
. If the value of thisSetMultimapExpression
changes, the value of theStringBinding
will be updated automatically.- Returns:
- A new
StringBinding
.
-
containsEntry
public boolean containsEntry(java.lang.Object key, java.lang.Object value)
- Specified by:
containsEntry
in interfaceMultimap<K,V>
-
containsKey
public boolean containsKey(java.lang.Object key)
- Specified by:
containsKey
in interfaceMultimap<K,V>
-
containsValue
public boolean containsValue(java.lang.Object value)
- Specified by:
containsValue
in interfaceMultimap<K,V>
-
emptyProperty
public abstract javafx.beans.property.ReadOnlyBooleanProperty emptyProperty()
A boolean property that reflects whether theSetMultimap
is empty.- Returns:
- A read-only property.
-
getValue
public ObservableSetMultimap<K,V> getValue()
- Specified by:
getValue
in interfacejavafx.beans.value.ObservableValue<K>
-
isEqualTo
public javafx.beans.binding.BooleanBinding isEqualTo(ObservableSetMultimap<?,?> other)
Creates a newBooleanBinding
that indicates whether thisObservableSetMultimap
is equal to the passed inObservableSetMultimap
.- Parameters:
other
- TheObservableSetMultimap
to compare thisObservableSetMultimap
to.- Returns:
- A new
BooleanBinding
.
-
isNotEqualTo
public javafx.beans.binding.BooleanBinding isNotEqualTo(ObservableSetMultimap<?,?> other)
Creates a newBooleanBinding
that indicates whether thisObservableSetMultimap
is not equal to the passed inObservableSetMultimap
.- Parameters:
other
- TheObservableSetMultimap
to compare thisObservableSetMultimap
to.- 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:ObservableSetMultimap
Replaces all the contents of theObservableSetMultimap
with the contents provided by the givenSetMultimap
.- Specified by:
replaceAll
in interfaceObservableSetMultimap<K,V>
- Parameters:
setMultimap
- TheSetMultimap
whose 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:
replaceValues
in interfaceMultimap<K,V>
- Specified by:
replaceValues
in 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 newObjectBinding
that contains the values that are mapped to the specified key.- Parameters:
key
- the key of the mapping- Returns:
- A new
SetBinding
.
-
-