in scala/collection
trait MapProxy

trait MapProxy[A,+B]()
extends Map[A,B]
with ScalaObject
with IterableProxy[Tuple2[A,B]]
Implementing classes or objects:
trait MapProxy[A,B]() in scala/collection/mutable

This is a simple wrapper class for scala.collection.Map. It is most useful for assembling customized map abstractions dynamically using object composition and forwarding.
Author:
Matthias Zenger
Version:
1.0, 21/07/2003

Method Summary
override def apply(key: A): B
     Retrieve the value which is associated with the given key.
override def contains(key: A): Boolean
     Is the given key mapped to a value by this map?
override def foreach(f: (A,B) => Unit): Unit
     Executes the given function for all (key, value) pairs contained in this map.
override def foreach(f: (A) => Unit): Unit
     Apply a function f to all elements of this iterable 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.
abstract def self: Map[A,B]
  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 values: Iterator[B]
     Creates an iterator for a contained values.

Methods inherited from java/lang/Object-class
clone, 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

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

Methods inherited from scala/Proxy-class
equals, hashCode, toString

Methods inherited from scala/ScalaObject-class
getScalaType

Method Detail

self

  abstract def self: Map[A,B]

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.

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

  override 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