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>,javafx.beans.Observable,javafx.beans.property.Property<ObservableMultiset<E>>,javafx.beans.property.ReadOnlyProperty<ObservableMultiset<E>>,javafx.beans.value.ObservableObjectValue<ObservableMultiset<E>>,javafx.beans.value.ObservableValue<ObservableMultiset<E>>,javafx.beans.value.WritableObjectValue<ObservableMultiset<E>>,javafx.beans.value.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
Properties -
Nested Class Summary
Nested classes/interfaces inherited from interface com.google.common.collect.Multiset
Multiset.Entry<E extends Object> -
Constructor Summary
ConstructorsConstructorDescriptionCreates a newMultisetPropertyBasewith no initial value.MultisetPropertyBase(ObservableMultiset<E> initialValue) Creates a newMultisetPropertyBasewith the givenObservableMultisetas initial value. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(javafx.beans.InvalidationListener listener) voidaddListener(javafx.beans.value.ChangeListener<? super ObservableMultiset<E>> listener) voidaddListener(MultisetChangeListener<? super E> listener) Adds aMultisetChangeListenerto thisObservableMultiset.protected voidappendValueToString(StringBuilder result) Appends a representation of thisSetMultimapProperty's value to the givenStringBuilder.voidbind(javafx.beans.value.ObservableValue<? extends ObservableMultiset<E>> observedValue) javafx.beans.property.ReadOnlyBooleanPropertyA boolean property that reflects whether theMultisetis empty.protected voidFires notifications to all attachedInvalidationListeners,ChangeListeners, andMultisetChangeListeners.protected voidfireValueChangedEvent(MultisetChangeListener.Change<? extends E> change) Fires notifications to all attachedInvalidationListeners,ChangeListeners, andMultisetChangeListeners.get()protected voidCan be overwritten by subclasses to receive invalidation notifications.booleanisBound()voidremoveListener(javafx.beans.InvalidationListener listener) voidremoveListener(javafx.beans.value.ChangeListener<? super ObservableMultiset<E>> listener) voidremoveListener(MultisetChangeListener<? super E> listener) Removes aMultisetChangeListenerfrom thisObservableMultiset.voidset(ObservableMultiset<E> newValue) javafx.beans.property.ReadOnlyIntegerPropertyAn integer property that represents the size of theMultiset.voidunbind()Methods inherited from class org.eclipse.gef.common.beans.property.MultisetProperty
bindBidirectional, setValue, unbindBidirectionalMethods inherited from class org.eclipse.gef.common.beans.property.ReadOnlyMultisetProperty
bindContent, bindContentBidirectional, equals, hashCode, toString, unbindContent, unbindContentBidirectionalMethods 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, toArrayMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
addAll, clear, isEmpty, parallelStream, removeIf, stream, toArray, toArray, toArrayMethods 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, toStringMethods inherited from interface org.eclipse.gef.common.collections.ObservableMultiset
replaceAllMethods inherited from interface javafx.beans.value.ObservableValue
getValueMethods inherited from interface javafx.beans.property.ReadOnlyProperty
getBean, getNameMethods inherited from interface javafx.beans.value.WritableValue
getValue
-
Property Details
-
empty
public javafx.beans.property.ReadOnlyBooleanProperty emptyProperty- Specified by:
emptyPropertyin classMultisetExpression<E>- See Also:
-
size
public javafx.beans.property.ReadOnlyIntegerProperty sizeProperty- Specified by:
sizePropertyin classMultisetExpression<E>
-
-
Constructor Details
-
MultisetPropertyBase
public MultisetPropertyBase()Creates a newMultisetPropertyBasewith no initial value. -
MultisetPropertyBase
Creates a newMultisetPropertyBasewith the givenObservableMultisetas initial value.- Parameters:
initialValue- The initial value of the to be createdMultisetPropertyBase.
-
-
Method Details
-
addListener
-
addListener
public void addListener(javafx.beans.InvalidationListener listener) -
addListener
Description copied from interface:ObservableMultisetAdds aMultisetChangeListenerto thisObservableMultiset. If the same listener is registered more than once, it will be notified more than once.- Parameters:
listener- TheMultisetChangeListenerto add.
-
appendValueToString
Description copied from class:ReadOnlyMultisetPropertyAppends a representation of thisSetMultimapProperty's value to the givenStringBuilder. Gets called fromReadOnlyMultisetProperty.toString()to allow subclasses to provide a changed value representation.- Overrides:
appendValueToStringin classReadOnlyMultisetProperty<E>- Parameters:
result- AStringBuilderto append the value representation to.
-
bind
-
emptyProperty
public javafx.beans.property.ReadOnlyBooleanProperty emptyProperty()Description copied from class:MultisetExpressionA boolean property that reflects whether theMultisetis empty.- Specified by:
emptyPropertyin 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
public void removeListener(javafx.beans.value.ChangeListener<? super ObservableMultiset<E>> listener) -
removeListener
public void removeListener(javafx.beans.InvalidationListener listener) -
removeListener
Description copied from interface:ObservableMultisetRemoves aMultisetChangeListenerfrom 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- TheMultisetChangeListenerto remove.
-
set
-
sizeProperty
public javafx.beans.property.ReadOnlyIntegerProperty sizeProperty()Description copied from class:MultisetExpressionAn integer property that represents the size of theMultiset.- Specified by:
sizePropertyin classMultisetExpression<E>
-
unbind
public void unbind()
-