Package org.eclipse.gef.common.collections

# Class MapListenerHelperEx.AtomicChange<K,V>

java.lang.Object
javafx.collections.MapChangeListener.Change<K,V>
org.eclipse.gef.common.collections.MapListenerHelperEx.AtomicChange<K,V>

Type Parameters:
  `K` - The key type of the source `ObservableMap`.
  `V` - The value type of the source `ObservableMap`.

Enclosing class:
  MapListenerHelperEx<K,V>

public static class MapListenerHelperEx.AtomicChange<K,V> extends javafx.collections.MapChangeListener.Change<K,V>
A simple implementation of an `MapChangeListener.Change`.

## Constructor Summary

Constructors
Constructor
Description
`AtomicChange(javafx.collections.ObservableMap<K,V> source, javafx.collections.MapChangeListener.Change<? extends K,? extends V> change)`
Creates a new `MapListenerHelperEx.AtomicChange` for the passed in source, based on the data provided in the passed-in change.
`AtomicChange(javafx.collections.ObservableMap<K,V> source, K key, V removedValue, V addedValue)`
Creates a new `MapListenerHelperEx.AtomicChange` that represents a change comprising a single elementary sub-change.

## Method Summary

Modifier and Type
Method
Description
`K`
`getKey()`
`V`
`getValueAdded()`
`V`
`getValueRemoved()`
`String`
`toString()`
`boolean`
`wasAdded()`
`boolean`
`wasRemoved()`

### Methods inherited from class javafx.collections.MapChangeListener.Change

`getMap`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### AtomicChange

public AtomicChange(javafx.collections.ObservableMap<K,V> source, K key, V removedValue, V addedValue)
Creates a new `MapListenerHelperEx.AtomicChange` that represents a change comprising a single elementary sub-change.

Parameters:
  `source` - The source `ObservableMap` from which the change originated.
  `key` - The key to which the change is related.
  `removedValue` - The value that was removed by this change or `null` if no value was removed.
  `addedValue` - The value that was added by this change or `null` if no value was added.

### AtomicChange

public AtomicChange(javafx.collections.ObservableMap<K,V> source, javafx.collections.MapChangeListener.Change<? extends K,? extends V> change)
Creates a new `MapListenerHelperEx.AtomicChange` for the passed in source, based on the data provided in the passed-in change.

This is basically used to allow properties wrapping an `ObservableMap` to re-fire change events of their wrapped `ObservableMap` with themselves as source.

Parameters:
  `source` - The new source `ObservableMap`.
  `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

public K getKey()

Specified by:
  `getKey` in class `javafx.collections.MapChangeListener.Change<K,V>`

### getValueAdded

public V getValueAdded()

Specified by:
  `getValueAdded` in class `javafx.collections.MapChangeListener.Change<K,V>`

### getValueRemoved

public V getValueRemoved()

Specified by:
  `getValueRemoved` in class `javafx.collections.MapChangeListener.Change<K,V>`

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### wasAdded

public boolean wasAdded()

Specified by:
  `wasAdded` in class `javafx.collections.MapChangeListener.Change<K,V>`

### wasRemoved

public boolean wasRemoved()

Specified by:
  `wasRemoved` in class `javafx.collections.MapChangeListener.Change<K,V>`