scala.collection.jcl

trait MapWrapper

[source: scala/collection/jcl/MapWrapper.scala]

trait MapWrapper[K, E]
extends Map[K, E]
A wrapper around a Java map.
Author
Sean McDirmid
Direct Known Subclasses:
HashMap, Hashtable, IdentityHashMap, LinkedHashMap, SortedMapWrapper, WeakHashMap

Method Summary
override def ++= (that : Iterable[(K, E)]) : Unit
Add a sequence of key/value pairs to this map.
override def clear : Unit
Removes all mappings from the map. After this operation is completed, the map is empty.
override def contains (key : K) : Boolean
Is the given key mapped to a value by this map?
override def elements : MutableIterator[(K, E)]
The default implementation of a map over mutable iterable collections.
override def equals (that : Any) : Boolean
Compares two maps structurally; i.e. checks if all mappings contained in this map are also contained in the other map, and vice versa.
override def get (key : K) : Option[E]
Check if this map maps key to a value and return the value if it exists.
override def hashCode : Int
A hash method compatible with equals
override def isEmpty : Boolean
Is this an empty map?
override def keySet : Projection[K]
override def put (key : K, elem : E) : Option[E]
Map key to elem in this map and return the element that the key was previously mapped to (if any).
override def removeKey (key : K) : Option[E]
Remove key from this map and return the element that the key was previously mapped to (if any).
override def size : Int
Compute the number of key-to-value mappings.
override def toString : java.lang.String
Creates a string representation for this map.
abstract def underlying : java.util.Map[K, E]
override def valueSet : Projection[E]
The values of this map as a projection, which means removals from the returned collection will remove the element from this map.
Methods inherited from Map
keys, has, update, +, +=, -, remove, -=, projection, lense, filterKeys
Methods inherited from Map
+=, ++=, +, ++, ++, -=, --=, --=, -, --, --, getOrElseUpdate, transform, retain, <<, clone, readOnly, +=, incl, excl
Methods inherited from Map
getOrElse, apply, isDefinedAt, values, default, mapElements, stringPrefix
Methods inherited from PartialFunction
orElse, andThen
Methods inherited from Function1
compose
Methods inherited from MutableIterable
removeAll, --, -, retainOnly, retainAll, size0
Methods inherited from Collection
toArray
Methods inherited from Iterable
concat, ++, map, flatMap, filter, partition, takeWhile, dropWhile, take, drop, foreach, forall, exists, find, findIndexOf, indexOf, foldLeft, foldRight, /:, :\, reduceLeft, reduceRight, copyToBuffer, sameElements, toList, toSeq, toStream, mkString, mkString, mkString, addString, addString, addString, copyToArray, hasDefiniteSize
Methods inherited from AnyRef
getClass, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Class Summary
class IteratorWrapper extends MutableIterator[(K, E)]
class KeySet extends KeySet with SetWrapper[K] with Projection[K]
class ValueSet extends IterableWrapper[E] with Projection[E]
Method Details
abstract def underlying : java.util.Map[K, E]

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

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

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

override def put(key : K, elem : E) : Option[E]
Map key to elem in this map and return the element that the key was previously mapped to (if any).
Overrides
Map.put

override def get(key : K) : Option[E]
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
Overrides
Map.get

override def ++=(that : Iterable[(K, E)]) : Unit
Add a sequence of key/value pairs to this map.
Parameters
kvs - the iterable object containing all key/value pairs.
Overrides
Map.++=

override def removeKey(key : K) : Option[E]
Remove key from this map and return the element that the key was previously mapped to (if any).
Overrides
Map.removeKey

override def contains(key : K) : 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

override def keySet : Projection[K]
Returns
the keys of this map as a set.
Overrides
Map.keySet

override def valueSet : Projection[E]
The values of this map as a projection, which means removals from the returned collection will remove the element from this map.
Returns
s a projection of this map's elements.
Overrides
Map.valueSet

override def elements : MutableIterator[(K, E)]
The default implementation of a map over mutable iterable collections.
Overrides
Map.elements

override def toString : java.lang.String
Creates a string representation for this map.
Returns
a string showing all mappings

override def hashCode : Int
A hash method compatible with equals

override def equals(that : Any) : Boolean
Compares two maps structurally; i.e. checks if all mappings contained in this map are also contained in the other map, and vice versa.
Parameters
that - the other map
Returns
true iff both maps contain exactly the same mappings.