Eclipse Platform
Kepler (4.3)

org.eclipse.core.databinding.observable.map
Class MapDiff

java.lang.Object
  extended by org.eclipse.core.databinding.observable.map.MapDiff
All Implemented Interfaces:
IDiff

public abstract class MapDiff
extends java.lang.Object
implements IDiff

Since:
1.1

Constructor Summary
MapDiff()
           
 
Method Summary
 void applyTo(java.util.Map map)
          Applies the changes in this diff to the given map
abstract  java.util.Set getAddedKeys()
           
abstract  java.util.Set getChangedKeys()
           
abstract  java.lang.Object getNewValue(java.lang.Object key)
          Returns the new value for the given key, which must be an element of getChangedKeys() or getAddedKeys().
abstract  java.lang.Object getOldValue(java.lang.Object key)
          Returns the old value for the given key, which must be an element of getRemovedKeys() or getChangedKeys().
abstract  java.util.Set getRemovedKeys()
           
 boolean isEmpty()
          Returns true if the diff has no added, removed or changed entries.
 java.util.Map simulateOn(java.util.Map map)
          Returns a map showing what map would look like if this diff were applied to it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapDiff

public MapDiff()
Method Detail

isEmpty

public boolean isEmpty()
Returns true if the diff has no added, removed or changed entries.

Returns:
true if the diff has no added, removed or changed entries.
Since:
1.2

applyTo

public void applyTo(java.util.Map map)
Applies the changes in this diff to the given map

Parameters:
map - the map to which the diff will be applied
Since:
1.2

simulateOn

public java.util.Map simulateOn(java.util.Map map)
Returns a map showing what map would look like if this diff were applied to it.

Note: the returned map is only valid until structural changes are made to the passed-in map.

Parameters:
map - the map over which the diff will be simulated
Returns:
an unmodifiable map showing what map would look like if it were passed to the applyTo(Map) method.
Since:
1.3
See Also:
applyTo(Map)

getAddedKeys

public abstract java.util.Set getAddedKeys()
Returns:
the set of keys which were added

getRemovedKeys

public abstract java.util.Set getRemovedKeys()
Returns:
the set of keys which were removed

getChangedKeys

public abstract java.util.Set getChangedKeys()
Returns:
the set of keys for which the value has changed

getOldValue

public abstract java.lang.Object getOldValue(java.lang.Object key)
Returns the old value for the given key, which must be an element of getRemovedKeys() or getChangedKeys().

Parameters:
key -
Returns:
the old value for the given key.

getNewValue

public abstract java.lang.Object getNewValue(java.lang.Object key)
Returns the new value for the given key, which must be an element of getChangedKeys() or getAddedKeys().

Parameters:
key -
Returns:
the new value for the given key.

Eclipse Platform
Kepler (4.3)

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2012. All rights reserved.