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
Since
1
Method Summary
def += (kv : (A, B)) : This
Add a new key/value mapping this map.
def -= (key : A) : This
Delete a key from this map if it is present.
def clear : Unit
Removes all elements from the set. After this operation is completed, the set will be empty.
Methods inherited from Publisher
subscribe, subscribe, suspendSubscription, activateSubscription, removeSubscription, removeSubscriptions, publish, equals
Methods inherited from Map
empty
Methods inherited from MapLike
newBuilder, put, update, updated, cached, +, +, ++, ++, remove, -, removeKey, getOrElseUpdate, transform, retain, clone, result, -, --, --
Methods inherited from Shrinkable
-=, --=, --=
Methods inherited from Builder
sizeHint, mapResult
Methods inherited from Growable
+=, ++=, ++=
Methods inherited from MapLikeBase
+
Methods inherited from MapLike
get (abstract), iterator (abstract), isEmpty, getOrElse, apply, contains, isDefinedAt, keySet, keysIterator, keys, valuesIterable, valuesIterator, values, default, filterKeys, mapValues, mapElements, +, ++, ++, addString, stringPrefix, toString, hashCode
Methods inherited from PartialFunction
orElse, andThen
Methods inherited from Function1
compose
Methods inherited from Iterable
companion
Methods inherited from IterableLike
thisCollection, toCollection, elements, foreach, forall, exists, find, foldRight, reduceRight, toIterable, head, take, slice, takeWhile, takeRight, dropRight, copyToArray, zip, zipAll, zipWithIndex, sameElements, toStream, canEqual, view, view, first, firstOption, projection
Methods inherited from GenericTraversableTemplate
genericBuilder, unzip, flatten, transpose
Methods inherited from TraversableLike
repr, nonEmpty, size, hasDefiniteSize, ++, ++, map, flatMap, filter, filterNot, partialMap, remove, partition, groupBy, count, foldLeft, /:, :\, reduceLeft, reduceLeftOption, reduceRightOption, sum, product, min, max, headOption, tail, last, lastOption, init, drop, dropWhile, span, splitAt, copyToBuffer, copyToArray, toArray, toList, toSeq, toIndexedSeq, toSet, mkString, mkString, mkString, addString, addString, withFilter
Methods inherited from AnyRef
getClass, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Method Details
def +=(kv : (A, B)) : This
Add a new key/value mapping this map.
Parameters
kv - the key/value pair.
Returns
the map itself

def -=(key : A) : This
Delete a key from this map if it is present.
Parameters
key - the key to be removed
Notes
same as `delete`.

def clear : Unit
Removes all elements from the set. After this operation is completed, the set will be empty.