scala.collection.mutable
trait ObservableMap

[source: `scala/collection/mutable/ObservableMap.scala`]

`` `trait` ObservableMap[A, B, This <: ObservableMap[A, B, This]]
  `extends` Map[A, B]`with` Publisher[Message[(A, B)]`with` Undoable, This]

  This class is typically used as a mixin. It adds a subscription mechanism to the `Map` class into which this abstract class is mixed in. Class `ObservableMap` publishes events of the type `Message`.

Author
  Matthias Zenger
  Martin Odersky
Version
  2.0, 31/12/2006

Method Summary
`def` | -= (key : A) : Unit Remove a key from this map, noop if key is not present.
`def` | clear : Unit Removes all mappings from the map. After this operation is completed, the map is empty.
`def` | update (key : A, value : B) : Unit This method allows one to add a new mapping from `key` to `value` to the map. If the map already contains a mapping for `key`, it will be overridden by this function.

Methods inherited from Publisher
subscribe, subscribe, suspendSubscription, activateSubscription, removeSubscription, removeSubscriptions, publish

Methods inherited from Map
+=, +=, ++=, ++=, +, +, ++, ++, -=, --=, --=, -, -, --, --, getOrElseUpdate, transform, retain, <<, clone, +=, incl, excl

Methods inherited from Map
size (abstract), get (abstract), getOrElse, isEmpty, apply, contains, isDefinedAt, keys, keySet, values, equals, hashCode, toString, default, projection

Methods inherited from Collection
toArray, stringPrefix

Methods inherited from Iterable
elements (abstract), concat, ++, map, flatMap, filter, takeWhile, dropWhile, take, drop, foreach, forall, exists, find, findIndexOf, indexOf, foldLeft, foldRight, /:, :\, reduceLeft, reduceRight, copyToBuffer, sameElements, toList, mkString, mkString, addString, addString, copyToArray, hasDefiniteSize

Methods inherited from PartialFunction
orElse, andThen

Methods inherited from Function1
compose

Methods inherited from AnyRef
getClass, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized

Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf

Method Details

`` `def` update(key : A, value : B) : Unit

  This method allows one to add a new mapping from `key` to `value` to the map. If the map already contains a mapping for `key`, it will be overridden by this function.

Parameters
  `key -` The key to update
  `value -` The new value

Overrides
  Map.update

`` `def` -=(key : A) : Unit

  Remove a key from this map, noop if key is not present.

Parameters
  `key -` the key to be removed

Overrides
  Map.-=

`` `def` clear : Unit

  Removes all mappings from the map. After this operation is completed, the map is empty.

Overrides
  Map.clear