• interface Map (K,T): MapView!(K,T), Dispenser!(T);
  • MutableMap supports standard update operations on maps.

    author:
    Doug Lea @version 0.93

    For an introduction to this package see Overview .

  • void add (K key, T element);
  • Include the indicated pair in the Map If a different pair with the same key was previously held, it is replaced by the new pair.

    @param key the key for element to include @param element the element to include

    Returns:


    condition:
     has(key, element) &&
     no spurious effects &&
     Version change iff !PREV(this).contains(key, element)

  • void opIndexAssign (T element, K key);
  • Include the indicated pair in the Map If a different pair with the same key was previously held, it is replaced by the new pair.

    @param element the element to include @param key the key for element to include

    Returns:


    condition:
     has(key, element) &&
     no spurious effects &&
     Version change iff !PREV(this).contains(key, element)

  • void removeKey (K key);
  • Remove the pair with the given key @param key the key

    Returns:


    condition:
     !containsKey(key)
     foreach (k in keys()) at(k).equals(PREV(this).at(k)) &&
     foreach (k in PREV(this).keys()) (!k.equals(key)) --> at(k).equals(PREV(this).at(k))
     (version() != PREV(this).version()) ==
     containsKey(key) !=  PREV(this).containsKey(key)

  • void replacePair (K key, T oldElement, T newElement);
  • Replace old pair with new pair with same key. No effect if pair not held. (This has the case of having no effect if the key exists but is bound to a different value.) @param key the key for the pair to remove @param oldElement the existing element @param newElement the value to replace it with

    Returns:


    condition:
     !contains(key, oldElement) || contains(key, newElement);
     no spurious effects &&
     Version change iff PREV(this).contains(key, oldElement)

    ) ) ) )
    :: page rendered by CandyDoc