in scala/collection/mutable
class JavaMapAdaptor

class JavaMapAdaptor[A,B](jmap: java.util.Map)
extends Map[A,B]
with ScalaObject

This class can be used as an adaptor to create mutable maps from Java classes that implementat the java.util.Map interface.
Author:
Matthias Zenger
Version:
1.0, 21/07/2003

Method Summary
  def -=(key: A): Unit
     This method removes a mapping from the given key.
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?
  def elements: Iterator[Tuple2[A,B]]
     Creates a new iterator over all elements contained in this object.
  def get(key: A): Option[B]
     Check if this map maps key to a value and return the value if it exists.
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.
  def size: Int
     Compute the number of key-to-value mappings.
  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, ne, notify, notifyAll, synchronized, wait, wait, wait

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

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

Methods inherited from scala/ScalaObject-class
getScalaType

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

Methods inherited from scala/collection/mutable/Map-class
++=, ++=, +=, --=, --=, <<, MapTo, excl, filter, hashCode, incl, map, mappingToString, toString

Method Detail

size

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

get

  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.

elements

  def elements: Iterator[Tuple2[A,B]]
Creates a new iterator over all elements contained in this object.
Returns:
the new iterator

update

  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 -
value -

-=

  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.

clear

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

clone

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