scala.collection.generic

trait MapProxyTemplate

[source: scala/collection/generic/MapProxyTemplate.scala]

trait MapProxyTemplate[A, +B, +This <: MapTemplate[A, B, This] with Map[A, B]]
extends MapTemplate[A, B, This] with IterableProxyTemplate[(A, B), This]
This trait implements a proxy for iterable objects. It forwards all calls to a different iterable object
Author
Martin Odersky
Version
2.8
Direct Known Subclasses:
MapProxy, MapProxy, MapProxy

Method Summary
override def addString (b : StringBuilder, start : java.lang.String, sep : java.lang.String, end : java.lang.String) : StringBuilder
Creates a string representation for this map.
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.
override def contains (key : A) : Boolean
Is the given key mapped to a value by this map?
override def default (key : A) : B
The default value for the map, returned when a key is not found The method implemented here yields an error, but it might be overridden in subclasses.
override def filterKeys (p : (A) => Boolean) : DefaultMap[A, B]
A map view consisting only of those key value pairs where the key satisfies a given predicate `p`.
override def get (key : A) : Option[B]
Check if this map maps key to a value and return the value as an option if it exists, None if not.
override def getOrElse [B1 >: B](key : A, default : => B1) : B1
Check if this map maps key to a value. Return that value if it exists, otherwise return default.
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 iterator : Iterator[(A, B)]
An iterator yielding all key/value mappings of this map.
override def keySet : Set[A]
override def keys : Iterator[A]
Creates an iterator for all keys.
override def keysIterator : Iterator[A]
Creates an iterator for all keys.
override def mapValues [C](f : (B) => C) : DefaultMap[A, C]
A map view resulting from applying a given function `f` to each value associated with a key in this map.
override def valueIterable : Iterable[B]
override def values : Iterator[B]
Creates an iterator for a contained values.
override def valuesIterator : Iterator[B]
Creates an iterator for a contained values.
Methods inherited from IterableProxyTemplate
foreach, foldRight, reduceRight, toIterable, head, takeRight, dropRight, sameElements, toStream, view, view
Methods inherited from TraversableProxyTemplate
self (abstract), nonEmpty, size, hasDefiniteSize, ++, ++, map, flatMap, filter, filterNot, remove, partition, groupBy, forall, exists, count, find, foldLeft, /:, :\, reduceLeft, reduceLeftOption, reduceRightOption, headOption, tail, last, lastOption, init, take, drop, slice, takeWhile, dropWhile, span, splitAt, copyToBuffer, copyToArray, copyToArray, toArray, toList, toSequence, toSet, mkString, mkString, mkString, addString, addString, stringPrefix
Methods inherited from Proxy
hashCode, equals, toString
Methods inherited from MapTemplate
empty (abstract), + (abstract), - (abstract), newBuilder, mapElements, updated, +, ++, ++
Methods inherited from Subtractable
-, --, --
Methods inherited from IterableTemplate
elements, first, firstOption, toSeq, projection
Methods inherited from TraversableTemplate
thisCollection, filterMap
Methods inherited from PartialFunction
orElse, andThen
Methods inherited from Function1
compose
Methods inherited from AnyRef
getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Method Details
override def get(key : A) : Option[B]
Check if this map maps key to a value and return the value as an option if it exists, None if not.
Parameters
key - the key of the mapping of interest.
Returns
the value of the mapping as an option, if it exists, or None.
Overrides
MapTemplate.get

override def iterator : Iterator[(A, B)]
An iterator yielding all key/value mappings of this map.
Overrides
MapTemplate.iterator, IterableProxyTemplate.iterator

override def isEmpty : Boolean
Is this an empty map?
Returns
true iff the map does not contain any key/value mapping.
Overrides
MapTemplate.isEmpty, IterableProxyTemplate.isEmpty

override def getOrElse[B1 >: B](key : A, default : => B1) : B1
Check if this map maps key to a value. Return that value if it exists, otherwise return default.
Parameters
key - the key.
default - a computation that yields a default value in case no binding for the key is found in the map.
Overrides
MapTemplate.getOrElse

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.
Overrides
MapTemplate.apply

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
Overrides
MapTemplate.contains

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
Overrides
MapTemplate.isDefinedAt

override def keySet : Set[A]
Returns
the keys of this map as a set.
Overrides
MapTemplate.keySet

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

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

override def valueIterable : Iterable[B]
Returns
the values of this map as an iterable.
Overrides
MapTemplate.valueIterable

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

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

override def default(key : A) : B
The default value for the map, returned when a key is not found The method implemented here yields an error, but it might be overridden in subclasses.
Parameters
key - the given key value
Throws
Predef.NoSuchElementException -
Overrides
MapTemplate.default

override def filterKeys(p : (A) => Boolean) : DefaultMap[A, B]
A map view consisting only of those key value pairs where the key satisfies a given predicate `p`.
Overrides
MapTemplate.filterKeys

override def mapValues[C](f : (B) => C) : DefaultMap[A, C]
A map view resulting from applying a given function `f` to each value associated with a key in this map.
Overrides
MapTemplate.mapValues

override def addString(b : StringBuilder, start : java.lang.String, sep : java.lang.String, end : java.lang.String) : StringBuilder
Creates a string representation for this map.
Returns
a string showing all mappings
Overrides
MapTemplate.addString