scala.collection

trait MapProxyLike

[source: scala/collection/MapProxyLike.scala]

trait MapProxyLike[A, +B, +This <: MapLike[A, B, This] with Map[A, B]]
extends MapLike[A, B, This] with IterableProxyLike[(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
Since
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 values : Iterator[B]
Creates an iterator for a contained values.
override def valuesIterable : Iterable[B]
override def valuesIterator : Iterator[B]
Creates an iterator for a contained values.
Methods inherited from IterableProxyLike
foreach, foldRight, reduceRight, toIterable, zip, zipAll, zipWithIndex, head, takeRight, dropRight, sameElements, toStream, view, view
Methods inherited from TraversableProxyLike
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, toSeq, toSet, mkString, mkString, mkString, addString, addString, stringPrefix
Methods inherited from Proxy
hashCode, equals, toString
Methods inherited from MapLike
empty (abstract), + (abstract), - (abstract), newBuilder, mapElements, updated, +, ++, ++
Methods inherited from Subtractable
-, --, --
Methods inherited from IterableLike
thisCollection, toCollection, elements, canEqual, first, firstOption, projection
Methods inherited from TraversableLike
repr, partialMap, sum, product, min, max, toIndexedSeq, withFilter
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
MapLike.get

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

override def isEmpty : Boolean
Is this an empty map?
Returns
true iff the map does not contain any key/value mapping.
Overrides
MapLike.isEmpty, IterableProxyLike.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
MapLike.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
MapLike.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
MapLike.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
MapLike.isDefinedAt

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

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

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

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

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

override def values : Iterator[B]
Creates an iterator for a contained values.
Returns
an iterator over all values.
Overrides
MapLike.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
MapLike.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
MapLike.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
MapLike.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
MapLike.addString