Package org.eclipse.core.databinding.observable.map

Examples of org.eclipse.core.databinding.observable.map.MapDiff


    }
    for (Iterator it = addedKeys.iterator(); it.hasNext();) {
      Object newKey = it.next();
      newValues.put(newKey, newMap.get(newKey));
    }
    return new MapDiff() {
      public Set getAddedKeys() {
        return addedKeys;
      }

      public Set getChangedKeys() {
View Full Code Here


   * @return a lazily computed {@link MapDiff} describing the change between
   *         the specified old and new map states.
   * @since 1.3
   */
  public static MapDiff computeLazyMapDiff(final Map oldMap, final Map newMap) {
    return new MapDiff() {

      private MapDiff lazyDiff;

      private MapDiff getLazyDiff() {
        if (lazyDiff == null) {
View Full Code Here

   * @param newValue
   * @return a map diff
   */
  public static MapDiff createMapDiffSingleAdd(final Object addedKey,
      final Object newValue) {
    return new MapDiff() {

      public Set getAddedKeys() {
        return Collections.singleton(addedKey);
      }

View Full Code Here

   * @param newValue
   * @return a map diff
   */
  public static MapDiff createMapDiffSingleChange(final Object existingKey,
      final Object oldValue, final Object newValue) {
    return new MapDiff() {

      public Set getAddedKeys() {
        return Collections.EMPTY_SET;
      }

View Full Code Here

   * @param oldValue
   * @return a map diff
   */
  public static MapDiff createMapDiffSingleRemove(final Object removedKey,
      final Object oldValue) {
    return new MapDiff() {

      public Set getAddedKeys() {
        return Collections.EMPTY_SET;
      }

View Full Code Here

  /**
   * @param copyOfOldMap
   * @return a map diff
   */
  public static MapDiff createMapDiffRemoveAll(final Map copyOfOldMap) {
    return new MapDiff() {

      public Set getAddedKeys() {
        return Collections.EMPTY_SET;
      }

View Full Code Here

   * @return a map diff
   */
  public static MapDiff createMapDiff(final Set addedKeys,
      final Set removedKeys, final Set changedKeys, final Map oldValues,
      final Map newValues) {
    return new MapDiff() {

      public Set getAddedKeys() {
        return addedKeys;
      }

View Full Code Here

      if (!Util.equals(oldValue, newValue)
          || staleMasterValues.contains(masterValue)) {
        cachedValues.put(masterValue, newValue);
        staleMasterValues.remove(masterValue);
        fireMapChange(new MapDiff() {
          public Set getAddedKeys() {
            return Collections.EMPTY_SET;
          }

          public Set getChangedKeys() {
View Full Code Here

    boolean add = !map.containsKey(key);

    Object oldValue = map.get(key);

    MapDiff diff;
    if (add)
      diff = Diffs.createMapDiffSingleAdd(key, value);
    else
      diff = Diffs.createMapDiffSingleChange(key, oldValue, value);
View Full Code Here

        addedKeys.add(key);
      }
      newValues.put(key, newValue);
    }

    MapDiff diff = Diffs.createMapDiff(addedKeys, Collections.EMPTY_SET,
        changedKeys, oldValues, newValues);
    updateMap(map, diff);
  }
View Full Code Here

TOP

Related Classes of org.eclipse.core.databinding.observable.map.MapDiff

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.