Class MultisetPropertyBase<E>
java.lang.Object
org.eclipse.gef.common.beans.binding.MultisetExpression<E>
org.eclipse.gef.common.beans.property.ReadOnlyMultisetProperty<E>
org.eclipse.gef.common.beans.property.MultisetProperty<E>
org.eclipse.gef.common.beans.property.MultisetPropertyBase<E>
- Type Parameters:
E
- The element type of the wrappedObservableMultiset
.
- All Implemented Interfaces:
Multiset<E>
,Iterable<E>
,Collection<E>
,Observable
,Property<ObservableMultiset<E>>
,ReadOnlyProperty<ObservableMultiset<E>>
,ObservableObjectValue<ObservableMultiset<E>>
,ObservableValue<ObservableMultiset<E>>
,WritableObjectValue<ObservableMultiset<E>>
,WritableValue<ObservableMultiset<E>>
,ObservableMultisetValue<E>
,WritableMultisetValue<E>
,ObservableMultiset<E>
- Direct Known Subclasses:
SimpleMultisetProperty
Abstract base class for implementing a
Property
wrapping an
ObservableMultiset
.
This class provides identical functionality for Multiset
as
MapPropertyBase
for Map
, SetPropertyBase
for
Set
, or ListPropertyBase
for List
.
-
Property Summary
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.google.common.collect.Multiset
Multiset.Entry<E extends Object>
-
Constructor Summary
ConstructorDescriptionCreates a newMultisetPropertyBase
with no initial value.MultisetPropertyBase
(ObservableMultiset<E> initialValue) Creates a newMultisetPropertyBase
with the givenObservableMultiset
as initial value. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(InvalidationListener listener) void
addListener
(ChangeListener<? super ObservableMultiset<E>> listener) void
addListener
(MultisetChangeListener<? super E> listener) Adds aMultisetChangeListener
to thisObservableMultiset
.protected void
appendValueToString
(StringBuilder result) Appends a representation of thisSetMultimapProperty
's value to the givenStringBuilder
.void
bind
(ObservableValue<? extends ObservableMultiset<E>> observedValue) A boolean property that reflects whether theMultiset
is empty.protected void
Fires notifications to all attachedInvalidationListeners
,ChangeListeners
, andMultisetChangeListeners
.protected void
fireValueChangedEvent
(MultisetChangeListener.Change<? extends E> change) Fires notifications to all attachedInvalidationListeners
,ChangeListeners
, andMultisetChangeListeners
.get()
protected void
Can be overwritten by subclasses to receive invalidation notifications.boolean
isBound()
void
removeListener
(InvalidationListener listener) void
removeListener
(ChangeListener<? super ObservableMultiset<E>> listener) void
removeListener
(MultisetChangeListener<? super E> listener) Removes aMultisetChangeListener
from thisObservableMultiset
.void
set
(ObservableMultiset<E> newValue) An integer property that represents the size of theMultiset
.void
unbind()
Methods inherited from class org.eclipse.gef.common.beans.property.MultisetProperty
bindBidirectional, setValue, unbindBidirectional
Methods inherited from class org.eclipse.gef.common.beans.property.ReadOnlyMultisetProperty
bindContent, bindContentBidirectional, equals, hashCode, toString, unbindContent, unbindContentBidirectional
Methods inherited from class org.eclipse.gef.common.beans.binding.MultisetExpression
add, add, addAll, asString, clear, contains, containsAll, count, elementSet, entrySet, getValue, isEmpty, isEqualTo, isNotEqualTo, isNotNull, isNull, iterator, multisetExpression, remove, remove, removeAll, replaceAll, retainAll, setCount, setCount, size, toArray, toArray
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
addAll, clear, isEmpty, parallelStream, removeIf, stream, toArray, toArray, toArray
Methods inherited from interface com.google.common.collect.Multiset
add, add, contains, containsAll, count, elementSet, entrySet, equals, forEach, forEachEntry, hashCode, iterator, remove, remove, removeAll, retainAll, setCount, setCount, size, spliterator, toString
Methods inherited from interface org.eclipse.gef.common.collections.ObservableMultiset
replaceAll
Methods inherited from interface javafx.beans.value.ObservableValue
getValue
Methods inherited from interface javafx.beans.property.ReadOnlyProperty
getBean, getName
Methods inherited from interface javafx.beans.value.WritableValue
getValue
-
Property Details
-
empty
- Specified by:
emptyProperty
in classMultisetExpression<E>
- See Also:
-
size
- Specified by:
sizeProperty
in classMultisetExpression<E>
-
-
Constructor Details
-
MultisetPropertyBase
public MultisetPropertyBase()Creates a newMultisetPropertyBase
with no initial value. -
MultisetPropertyBase
Creates a newMultisetPropertyBase
with the givenObservableMultiset
as initial value.- Parameters:
initialValue
- The initial value of the to be createdMultisetPropertyBase
.
-
-
Method Details
-
addListener
-
addListener
-
addListener
Description copied from interface:ObservableMultiset
Adds aMultisetChangeListener
to thisObservableMultiset
. If the same listener is registered more than once, it will be notified more than once.- Parameters:
listener
- TheMultisetChangeListener
to add.
-
appendValueToString
Description copied from class:ReadOnlyMultisetProperty
Appends a representation of thisSetMultimapProperty
's value to the givenStringBuilder
. Gets called fromReadOnlyMultisetProperty.toString()
to allow subclasses to provide a changed value representation.- Overrides:
appendValueToString
in classReadOnlyMultisetProperty<E>
- Parameters:
result
- AStringBuilder
to append the value representation to.
-
bind
-
emptyProperty
Description copied from class:MultisetExpression
A boolean property that reflects whether theMultiset
is empty.- Specified by:
emptyProperty
in classMultisetExpression<E>
- See Also:
-
fireValueChangedEvent
protected void fireValueChangedEvent()Fires notifications to all attachedInvalidationListeners
,ChangeListeners
, andMultisetChangeListeners
. -
fireValueChangedEvent
Fires notifications to all attachedInvalidationListeners
,ChangeListeners
, andMultisetChangeListeners
.- Parameters:
change
- the change that needs to be propagated
-
get
-
invalidated
protected void invalidated()Can be overwritten by subclasses to receive invalidation notifications. Does nothing by default. -
isBound
public boolean isBound() -
removeListener
-
removeListener
-
removeListener
Description copied from interface:ObservableMultiset
Removes aMultisetChangeListener
from thisObservableMultiset
. Will do nothing if the listener was not attached to thisObservableMultiset
. If it was added more than once, then only the first occurrence will be removed.- Parameters:
listener
- TheMultisetChangeListener
to remove.
-
set
-
sizeProperty
Description copied from class:MultisetExpression
An integer property that represents the size of theMultiset
.- Specified by:
sizeProperty
in classMultisetExpression<E>
-
unbind
public void unbind()
-