Class SetMultimapListenerHelper.AtomicChange<K,V>
- Type Parameters:
K- The key type of the sourceObservableSetMultimap.V- The value type of the sourceObservableSetMultimap.
- Enclosing class:
- SetMultimapListenerHelper<K,
V>
SetMultimapChangeListener.Change.-
Constructor Summary
ConstructorsConstructorDescriptionAtomicChange(ObservableSetMultimap<K, V> source, SetMultimap<K, V> previousContents, List<SetMultimapListenerHelper.ElementarySubChange<K, V>> elementarySubChanges) Creates a newMultisetListenerHelper.AtomicChangethat represents a change comprising multiple elementary sub-changesO.AtomicChange(ObservableSetMultimap<K, V> source, SetMultimap<K, V> previousContents, SetMultimapListenerHelper.ElementarySubChange<K, V> elementarySubChange) Creates a newSetMultimapListenerHelper.AtomicChangethat represents a change comprising a single elementary sub-change.AtomicChange(ObservableSetMultimap<K, V> source, SetMultimapChangeListener.Change<? extends K, ? extends V> change) Creates a newMultisetListenerHelper.AtomicChangefor the passed in source, based on the data provided in the passed-in change. -
Method Summary
Modifier and TypeMethodDescriptiongetKey()The key associated with the current elementary sub-change.Returns an unmodifiableSetMultimapthat contains the previous contents of the sourceObservableSetMultimapbefore the atomic change was applied.Retrieves the values that were added for the given key in the current elementary sub-change.Retrieves the values that were removed for the given key in the current elementary sub-change.booleannext()Places the internal cursor on the next elementary sub-change, so that it be processed usingSetMultimapChangeListener.Change.getKey(),SetMultimapChangeListener.Change.getValuesAdded(), andSetMultimapChangeListener.Change.getValuesRemoved(),SetMultimapChangeListener.Change.wasAdded(), andSetMultimapChangeListener.Change.wasRemoved().voidreset()Reset the internal cursor to the initial state, so that the first elementary sub-change can be accessed by callingSetMultimapChangeListener.Change.next().toString()booleanwasAdded()Indicates whether elements were added to theObservableSetMultimapduring this elementary sub-change.booleanIndicates whether elements were removed from theObservableSetMultimapin the current elementary sub-change.Methods inherited from class org.eclipse.gef.common.collections.SetMultimapChangeListener.Change
getSetMultimap
-
Constructor Details
-
AtomicChange
public AtomicChange(ObservableSetMultimap<K, V> source, SetMultimap<K, V> previousContents, SetMultimapListenerHelper.ElementarySubChange<K, V> elementarySubChange) Creates a newSetMultimapListenerHelper.AtomicChangethat represents a change comprising a single elementary sub-change.- Parameters:
source- The sourceObservableSetMultimapfrom which the change originated.previousContents- The previous contents of theObservableSetMultimapbefore the change was applied.elementarySubChange- The elementary sub-change that has been applied.
-
AtomicChange
public AtomicChange(ObservableSetMultimap<K, V> source, SetMultimap<K, V> previousContents, List<SetMultimapListenerHelper.ElementarySubChange<K, V>> elementarySubChanges) Creates a newMultisetListenerHelper.AtomicChangethat represents a change comprising multiple elementary sub-changesO.- Parameters:
source- The sourceObservableMultisetfrom which the change originated.previousContents- The previous contents of theObservableMultisetbefore the change was applied.elementarySubChanges- The elementary sub-changes that have been applied as part of this change.
-
AtomicChange
public AtomicChange(ObservableSetMultimap<K, V> source, SetMultimapChangeListener.Change<? extends K, ? extends V> change) Creates a newMultisetListenerHelper.AtomicChangefor the passed in source, based on the data provided in the passed-in change.This is basically used to allow properties wrapping an
ObservableMultisetto re-fire change events of their wrappedObservableMultisetwith themselves as source.- Parameters:
source- The new sourceObservableMultiset.change- The change to infer a new change from. It is expected that the change is in initial state. In either case it will be reset to initial state.
-
-
Method Details
-
getKey
Description copied from class:SetMultimapChangeListener.ChangeThe key associated with the current elementary sub-change.This method depends on the state of the internal cursor that can be manipulated via
SetMultimapChangeListener.Change.next()andSetMultimapChangeListener.Change.reset().- Specified by:
getKeyin classSetMultimapChangeListener.Change<K,V> - Returns:
- The key for which values were added or removed.
-
getPreviousContents
Description copied from class:SetMultimapChangeListener.ChangeReturns an unmodifiableSetMultimapthat contains the previous contents of the sourceObservableSetMultimapbefore the atomic change was applied.This method does not depend on the state of the internal cursor, may thus be accessed independent on which elementary sub-change is currently processed.
- Specified by:
getPreviousContentsin classSetMultimapChangeListener.Change<K,V> - Returns:
- An unmodifiable
SetMultimaprepresenting the contents of theObservableSetMultimapbefore the change.
-
getValuesAdded
Description copied from class:SetMultimapChangeListener.ChangeRetrieves the values that were added for the given key in the current elementary sub-change.This method depends on the state of the internal cursor that can be manipulated via
SetMultimapChangeListener.Change.next()andSetMultimapChangeListener.Change.reset().- Specified by:
getValuesAddedin classSetMultimapChangeListener.Change<K,V> - Returns:
- The values that have become associated with the key.
-
getValuesRemoved
Description copied from class:SetMultimapChangeListener.ChangeRetrieves the values that were removed for the given key in the current elementary sub-change.This method depends on the state of the internal cursor that can be manipulated via
SetMultimapChangeListener.Change.next()andSetMultimapChangeListener.Change.reset().- Specified by:
getValuesRemovedin classSetMultimapChangeListener.Change<K,V> - Returns:
- The values previously associated with the key.
-
next
public boolean next()Description copied from class:SetMultimapChangeListener.ChangePlaces the internal cursor on the next elementary sub-change, so that it be processed usingSetMultimapChangeListener.Change.getKey(),SetMultimapChangeListener.Change.getValuesAdded(), andSetMultimapChangeListener.Change.getValuesRemoved(),SetMultimapChangeListener.Change.wasAdded(), andSetMultimapChangeListener.Change.wasRemoved(). This method has to be called initially to have the internal cursor point to the first elementary sub-change that is comprised.- Specified by:
nextin classSetMultimapChangeListener.Change<K,V> - Returns:
trueif the internal cursor could be switched to the next elementary sub-change,falseif the current elementary sub-change was the last change that is comprised.
-
reset
public void reset()Description copied from class:SetMultimapChangeListener.ChangeReset the internal cursor to the initial state, so that the first elementary sub-change can be accessed by callingSetMultimapChangeListener.Change.next().- Specified by:
resetin classSetMultimapChangeListener.Change<K,V>
-
toString
-
wasAdded
public boolean wasAdded()Description copied from class:SetMultimapChangeListener.ChangeIndicates whether elements were added to theObservableSetMultimapduring this elementary sub-change.This method depends on the state of the internal cursor that can be manipulated via
SetMultimapChangeListener.Change.next()andSetMultimapChangeListener.Change.reset().- Specified by:
wasAddedin classSetMultimapChangeListener.Change<K,V> - Returns:
trueif new values or (key-value) entries were added to theObservableSetMultimap,falseotherwise.
-
wasRemoved
public boolean wasRemoved()Description copied from class:SetMultimapChangeListener.ChangeIndicates whether elements were removed from theObservableSetMultimapin the current elementary sub-change.This method depends on the state of the internal cursor that can be manipulated via
SetMultimapChangeListener.Change.next()andSetMultimapChangeListener.Change.reset().- Specified by:
wasRemovedin classSetMultimapChangeListener.Change<K,V> - Returns:
trueif old values or (key-value) entries were removed from theObservableSetMultimap,falseotherwise.
-