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>
ASetMultimapExpression
is aObservableMultisetValue
plus additional convenience methods to generate bindings.This class provides identical functionality for
Multiset
asMapExpression
forMap
,SetExpression
forSet
, orListExpression
forList
.
-
-
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 boolean
add(E element)
int
add(E element, int occurrences)
boolean
addAll(java.util.Collection<? extends E> c)
javafx.beans.binding.StringBinding
asString()
void
clear()
boolean
contains(java.lang.Object element)
boolean
containsAll(java.util.Collection<?> elements)
int
count(java.lang.Object element)
java.util.Set<E>
elementSet()
abstract javafx.beans.property.ReadOnlyBooleanProperty
emptyProperty()
A boolean property that reflects whether theMultiset
is empty.java.util.Set<Multiset.Entry<E>>
entrySet()
ObservableMultiset<E>
getValue()
boolean
isEmpty()
javafx.beans.binding.BooleanBinding
isEqualTo(ObservableMultiset<?> other)
Creates a newBooleanBinding
that indicates whether thisObservableMultiset
is equal to the passed inObservableMultiset
.javafx.beans.binding.BooleanBinding
isNotEqualTo(ObservableMultiset<?> other)
Creates a newBooleanBinding
that indicates whether thisObservableMultiset
is not equal to the passed inObservableMultiset
.javafx.beans.binding.BooleanBinding
isNotNull()
javafx.beans.binding.BooleanBinding
isNull()
java.util.Iterator<E>
iterator()
static <E> MultisetExpression<E>
multisetExpression(ObservableMultisetValue<E> multisetValue)
Returns aMultisetExpression
that wraps anObservableMultisetValue
.boolean
remove(java.lang.Object element)
int
remove(java.lang.Object element, int occurrences)
boolean
removeAll(java.util.Collection<?> c)
boolean
replaceAll(Multiset<? extends E> multiset)
Replaces all the contents of theObservableMultiset
with the contents provided by the givenMultiset
.boolean
retainAll(java.util.Collection<?> c)
int
setCount(E element, int count)
boolean
setCount(E element, int oldCount, int newCount)
int
size()
abstract javafx.beans.property.ReadOnlyIntegerProperty
sizeProperty()
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 aMultisetExpression
that wraps anObservableMultisetValue
. If theObservableMultisetValue
is already aMultisetExpression
, it will be returned. Otherwise a new concreteMultisetBinding
is created that is bound to theObservableMultisetValue
.- Type Parameters:
E
- The element type of theMultisetExpression
.- Parameters:
multisetValue
- TheObservableMultisetValue
for which to return aMultisetExpression
.- Returns:
- The passed in
ObservableMultisetValue
if its already aMultisetExpression
, or a newly createdMultisetBinding
for it.
-
add
public boolean add(E element)
-
addAll
public boolean addAll(java.util.Collection<? extends E> c)
- Specified by:
addAll
in interfacejava.util.Collection<E>
-
asString
public javafx.beans.binding.StringBinding asString()
Creates aStringBinding
that holds the value of theMultisetExpression
turned into aString
. If the value of thisSetMultimapExpression
changes, the value of theStringBinding
will be updated automatically.- Returns:
- A new
StringBinding
.
-
clear
public void clear()
- Specified by:
clear
in interfacejava.util.Collection<E>
-
contains
public boolean contains(java.lang.Object element)
-
containsAll
public boolean containsAll(java.util.Collection<?> elements)
- Specified by:
containsAll
in interfacejava.util.Collection<E>
- Specified by:
containsAll
in interfaceMultiset<E>
-
elementSet
public java.util.Set<E> elementSet()
- Specified by:
elementSet
in interfaceMultiset<E>
-
emptyProperty
public abstract javafx.beans.property.ReadOnlyBooleanProperty emptyProperty()
A boolean property that reflects whether theMultiset
is empty.- Returns:
- A read-only property.
-
entrySet
public java.util.Set<Multiset.Entry<E>> entrySet()
-
getValue
public ObservableMultiset<E> getValue()
- Specified by:
getValue
in interfacejavafx.beans.value.ObservableValue<E>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfacejava.util.Collection<E>
-
isEqualTo
public javafx.beans.binding.BooleanBinding isEqualTo(ObservableMultiset<?> other)
Creates a newBooleanBinding
that indicates whether thisObservableMultiset
is equal to the passed inObservableMultiset
.- Parameters:
other
- TheObservableMultiset
to compare thisObservableMultiset
to.- Returns:
- A new
BooleanBinding
.
-
isNotEqualTo
public javafx.beans.binding.BooleanBinding isNotEqualTo(ObservableMultiset<?> other)
Creates a newBooleanBinding
that indicates whether thisObservableMultiset
is not equal to the passed inObservableMultiset
.- Parameters:
other
- TheObservableMultiset
to compare thisObservableMultiset
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
.
-
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:ObservableMultiset
Replaces all the contents of theObservableMultiset
with the contents provided by the givenMultiset
.- Specified by:
replaceAll
in interfaceObservableMultiset<E>
- Parameters:
multiset
- TheMultiset
whose 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:
toArray
in interfacejava.util.Collection<E>
-
toArray
public <T> T[] toArray(T[] a)
- Specified by:
toArray
in interfacejava.util.Collection<E>
-
-