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

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


    if (!map.containsKey(key))
      return null;

    Object oldValue = map.get(key);

    MapDiff diff = Diffs.createMapDiffSingleRemove(key, oldValue);
    updateMap(map, diff);

    return oldValue;
  }
View Full Code Here


    Map map = getMap();
    if (map.isEmpty())
      return;

    MapDiff diff = Diffs.createMapDiffRemoveAll(new HashMap(map));
    updateMap(map, diff);
  }
View Full Code Here

    public void remove() {
      getterCalled();
      checkForComodification();

      MapDiff diff = Diffs.createMapDiffSingleRemove(last.getKey(),
          last.getValue());
      updateMap(map, diff);

      iterator.remove(); // stay in sync
View Full Code Here

    }
    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

   * @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

  private void markDirty() {
    // since we are dirty, we don't need to listen anymore
    removeElementChangeListener();
    final Map oldMap = wrappedMap;
    // lazy computation of diff
    MapDiff mapDiff = new MapDiff() {
      private MapDiff cachedDiff = null;

      private void ensureCached() {
        if (cachedDiff == null) {
          recompute();
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.