Class MultisetExpression<E>
- java.lang.Object
-
- org.eclipse.gef.common.beans.binding.MultisetExpression<E>
-
- Type Parameters:
E- The element type of theObservableMultiset.
- All Implemented Interfaces:
Multiset<E>,java.lang.Iterable<E>,java.util.Collection<E>,javafx.beans.Observable,javafx.beans.value.ObservableObjectValue<ObservableMultiset<E>>,javafx.beans.value.ObservableValue<ObservableMultiset<E>>,ObservableMultisetValue<E>,ObservableMultiset<E>
- Direct Known Subclasses:
MultisetBinding,ReadOnlyMultisetProperty
public abstract class MultisetExpression<E> extends java.lang.Object implements ObservableMultisetValue<E>
ASetMultimapExpressionis aObservableMultisetValueplus additional convenience methods to generate bindings.This class provides identical functionality for
MultisetasMapExpressionforMap,SetExpressionforSet, orListExpressionforList.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.google.common.collect.Multiset
Multiset.Entry<E extends java.lang.Object>
-
-
Constructor Summary
Constructors Constructor Description MultisetExpression()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanadd(E element)intadd(E element, int occurrences)booleanaddAll(java.util.Collection<? extends E> c)javafx.beans.binding.StringBindingasString()voidclear()booleancontains(java.lang.Object element)booleancontainsAll(java.util.Collection<?> elements)intcount(java.lang.Object element)java.util.Set<E>elementSet()abstract javafx.beans.property.ReadOnlyBooleanPropertyemptyProperty()A boolean property that reflects whether theMultisetis empty.java.util.Set<Multiset.Entry<E>>entrySet()ObservableMultiset<E>getValue()booleanisEmpty()javafx.beans.binding.BooleanBindingisEqualTo(ObservableMultiset<?> other)Creates a newBooleanBindingthat indicates whether thisObservableMultisetis equal to the passed inObservableMultiset.javafx.beans.binding.BooleanBindingisNotEqualTo(ObservableMultiset<?> other)Creates a newBooleanBindingthat indicates whether thisObservableMultisetis not equal to the passed inObservableMultiset.javafx.beans.binding.BooleanBindingisNotNull()javafx.beans.binding.BooleanBindingisNull()java.util.Iterator<E>iterator()static <E> MultisetExpression<E>multisetExpression(ObservableMultisetValue<E> multisetValue)Returns aMultisetExpressionthat wraps anObservableMultisetValue.booleanremove(java.lang.Object element)intremove(java.lang.Object element, int occurrences)booleanremoveAll(java.util.Collection<?> c)booleanreplaceAll(Multiset<? extends E> multiset)Replaces all the contents of theObservableMultisetwith the contents provided by the givenMultiset.booleanretainAll(java.util.Collection<?> c)intsetCount(E element, int count)booleansetCount(E element, int oldCount, int newCount)intsize()abstract javafx.beans.property.ReadOnlyIntegerPropertysizeProperty()An integer property that represents the size of theMultiset.java.lang.Object[]toArray()<T> T[]toArray(T[] a)-
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.Multiset
equals, forEach, forEachEntry, hashCode, spliterator, toString
-
Methods inherited from interface org.eclipse.gef.common.collections.ObservableMultiset
addListener, removeListener
-
-
-
-
Method Detail
-
multisetExpression
public static <E> MultisetExpression<E> multisetExpression(ObservableMultisetValue<E> multisetValue)
Returns aMultisetExpressionthat wraps anObservableMultisetValue. If theObservableMultisetValueis already aMultisetExpression, it will be returned. Otherwise a new concreteMultisetBindingis created that is bound to theObservableMultisetValue.- Type Parameters:
E- The element type of theMultisetExpression.- Parameters:
multisetValue- TheObservableMultisetValuefor which to return aMultisetExpression.- Returns:
- The passed in
ObservableMultisetValueif its already aMultisetExpression, or a newly createdMultisetBindingfor it.
-
add
public boolean add(E element)
-
addAll
public boolean addAll(java.util.Collection<? extends E> c)
- Specified by:
addAllin interfacejava.util.Collection<E>
-
asString
public javafx.beans.binding.StringBinding asString()
Creates aStringBindingthat holds the value of theMultisetExpressionturned into aString. If the value of thisSetMultimapExpressionchanges, the value of theStringBindingwill be updated automatically.- Returns:
- A new
StringBinding.
-
clear
public void clear()
- Specified by:
clearin interfacejava.util.Collection<E>
-
contains
public boolean contains(java.lang.Object element)
-
containsAll
public boolean containsAll(java.util.Collection<?> elements)
- Specified by:
containsAllin interfacejava.util.Collection<E>- Specified by:
containsAllin interfaceMultiset<E>
-
elementSet
public java.util.Set<E> elementSet()
- Specified by:
elementSetin interfaceMultiset<E>
-
emptyProperty
public abstract javafx.beans.property.ReadOnlyBooleanProperty emptyProperty()
A boolean property that reflects whether theMultisetis empty.- Returns:
- A read-only property.
-
entrySet
public java.util.Set<Multiset.Entry<E>> entrySet()
-
getValue
public ObservableMultiset<E> getValue()
- Specified by:
getValuein interfacejavafx.beans.value.ObservableValue<E>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfacejava.util.Collection<E>
-
isEqualTo
public javafx.beans.binding.BooleanBinding isEqualTo(ObservableMultiset<?> other)
Creates a newBooleanBindingthat indicates whether thisObservableMultisetis equal to the passed inObservableMultiset.- Parameters:
other- TheObservableMultisetto compare thisObservableMultisetto.- Returns:
- A new
BooleanBinding.
-
isNotEqualTo
public javafx.beans.binding.BooleanBinding isNotEqualTo(ObservableMultiset<?> other)
Creates a newBooleanBindingthat indicates whether thisObservableMultisetis not equal to the passed inObservableMultiset.- Parameters:
other- TheObservableMultisetto compare thisObservableMultisetto.- 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.
-
iterator
public java.util.Iterator<E> iterator()
-
remove
public boolean remove(java.lang.Object element)
-
remove
public int remove(java.lang.Object element, int occurrences)
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
-
replaceAll
public boolean replaceAll(Multiset<? extends E> multiset)
Description copied from interface:ObservableMultisetReplaces all the contents of theObservableMultisetwith the contents provided by the givenMultiset.- Specified by:
replaceAllin interfaceObservableMultiset<E>- Parameters:
multiset- TheMultisetwhose values should be used to replace those of thisObservableMultiset.- Returns:
- Whether this map was changed through the replace operation.
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
-
setCount
public boolean setCount(E element, int oldCount, int newCount)
-
size
public int size()
-
sizeProperty
public abstract javafx.beans.property.ReadOnlyIntegerProperty sizeProperty()
An integer property that represents the size of theMultiset.- Returns:
- A read-only property.
-
toArray
public java.lang.Object[] toArray()
- Specified by:
toArrayin interfacejava.util.Collection<E>
-
toArray
public <T> T[] toArray(T[] a)
- Specified by:
toArrayin interfacejava.util.Collection<E>
-
-