in scala/collection/mutable
trait SynchronizedMap

trait SynchronizedMap[A,B]()
extends Map[A,B]
with ScalaObject

This trait should be used as a mixin. It synchronizes the Map functions of the class into which it is mixed in.
Author:
Matthias Zenger
Version:
1.0, 08/07/2003

Method Summary
override def ++=(map: Iterable[Tuple2[A,B]]): Unit
     This method adds all the mappings provided by an iterator of parameter map to the map.
override def ++=(it: Iterator[Tuple2[A,B]]): Unit
     This method adds all the mappings provided by an iterator of parameter map to the map.
override def --=(keys: Iterable[A]): Unit
     This method removes all the mappings for keys provided by an iterator over the elements of the keys object.
override def --=(it: Iterator[A]): Unit
     This method removes all the mappings for keys provided by an iterator over the elements of the keys object.
override def -=(key: A): Unit
     This method removes a mapping from the given key.
override def <<(cmd: Message[Tuple2[A,B]]): Unit
     Send a message to this scriptable object.
override def apply(key: A): B
     Retrieve the value which is associated with the given key.
override def clear: Unit
     Removes all mappings from the map.
override def clone(): Map[A,B]
     Return a clone of this map.
override def contains(key: A): Boolean
     Is the given key mapped to a value by this map?
override def excl(keys: A*): Unit
     This method will remove all the mappings for the given sequence of keys from the map.
override def filter(p: (A,B) => Boolean): Unit
     This method removes all the mappings for which the predicate p returns false.
override def foreach(f: (A,B) => Unit): Unit
     Executes the given function for all (key, value) pairs contained in this map.
  def foreach(f: (A) => Unit): Unit
     Apply a function f to all elements of this iterable object.
override def get(key: A): Option[B]
     Check if this map maps key to a value and return the value if it exists.
override def incl(mappings: Tuple2[A,B]*): Unit
     incl can be used to add many mappings at the same time to the map.
override def isDefinedAt(key: A): Boolean
     Does this map contain a mapping from the given key to a value?
override def isEmpty: Boolean
     Is this an empty map?
override def keys: Iterator[A]
     Creates an iterator for all keys.
override def map(f: (A,B) => B): Unit
     This function transforms all the values of mappings contained in this map with function f.
override def size: Int
     Compute the number of key-to-value mappings.
override def toList: List[Tuple2[A,B]]
     Returns the mappings of this map as a list.
override def toString(): String
     Returns a string representation of this map which shows all the mappings.
override def update(key: A, value: B): Unit
     This method allows one to add a new mapping from key to value to the map.
override def values: Iterator[B]
     Creates an iterator for a contained values.

Methods inherited from java/lang/Object-class
eq, finalize, getClass, notify, notifyAll, synchronized, wait, wait, wait

Methods inherited from scala/Any-class
!=, ==, asInstanceOf, isInstanceOf, match

Methods inherited from scala/Iterable-class
/:, :\, elements, exists, find, foldLeft, foldRight, forall, foreach, sameElements

Methods inherited from scala/collection/Map-class
equals, exists, forall

Methods inherited from scala/collection/mutable/Map-class
+=, hashCode, mappingToString

Method Detail

size

  override def size: Int
Compute the number of key-to-value mappings.
Returns:
the number of mappings

get

  override def get(key: A): Option[B]
Check if this map maps key to a value and return the value if it exists.
Parameters:
key - the key of the mapping of interest
Returns:
the value of the mapping, if it exists

isEmpty

  override def isEmpty: Boolean
Is this an empty map?
Returns:
true, iff the map is empty.

apply

  override def apply(key: A): B
Retrieve the value which is associated with the given key. This method throws an exception if there is no mapping from the given key to a value.
Parameters:
key - the key
Returns:
the value associated with the given key.

contains

  override def contains(key: A): Boolean
Is the given key mapped to a value by this map?
Parameters:
key - the key
Returns:
true, iff there is a mapping for key in this map

isDefinedAt

  override def isDefinedAt(key: A): Boolean
Does this map contain a mapping from the given key to a value?
Parameters:
key - the key
Returns:
true, iff there is a mapping for key in this map

keys

  override def keys: Iterator[A]
Creates an iterator for all keys.
Returns:
an iterator over all keys.

values

  override def values: Iterator[B]
Creates an iterator for a contained values.
Returns:
an iterator over all values.

foreach

  override def foreach(f: (A,B) => Unit): Unit
Executes the given function for all (key, value) pairs contained in this map.
Parameters:
f - the function to execute.

foreach

  def foreach(f: (A) => Unit): Unit
Apply a function f to all elements of this iterable object.
Parameters:
f - a function that is applied to every element.

toList

  override def toList: List[Tuple2[A,B]]
Returns the mappings of this map as a list.
Returns:
a list containing all mappings

update

  override 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.

++=

  override def ++=(map: Iterable[Tuple2[A,B]]): Unit
This method adds all the mappings provided by an iterator of parameter map to the map.

++=

  override def ++=(it: Iterator[Tuple2[A,B]]): Unit
This method adds all the mappings provided by an iterator of parameter map to the map.

incl

  override def incl(mappings: Tuple2[A,B]*): Unit
incl can be used to add many mappings at the same time to the map. The method assumes that a mapping is represented by a Pair object who's first component denotes the key, and who's second component refers to the value.

-=

  override def -=(key: A): Unit
This method removes a mapping from the given key. If the map does not contain a mapping for the given key, the method does nothing.

--=

  override def --=(keys: Iterable[A]): Unit
This method removes all the mappings for keys provided by an iterator over the elements of the keys object.

--=

  override def --=(it: Iterator[A]): Unit
This method removes all the mappings for keys provided by an iterator over the elements of the keys object.

excl

  override def excl(keys: A*): Unit
This method will remove all the mappings for the given sequence of keys from the map.

clear

  override def clear: Unit
Removes all mappings from the map. After this operation is completed, the map is empty.

map

  override def map(f: (A,B) => B): Unit
This function transforms all the values of mappings contained in this map with function f.

filter

  override def filter(p: (A,B) => Boolean): Unit
This method removes all the mappings for which the predicate p returns false.

toString

  override def toString(): String
Returns a string representation of this map which shows all the mappings.

<<

  override def <<(cmd: Message[Tuple2[A,B]]): Unit
Send a message to this scriptable object.
Parameters:
cmd - the message to send.

clone

  override def clone(): Map[A,B]
Return a clone of this map.
Returns:
an map with the same elements.