diff options
Diffstat (limited to 'src/dotnet-library/scala/collection/mutable/HashMap.scala')
-rw-r--r-- | src/dotnet-library/scala/collection/mutable/HashMap.scala | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/dotnet-library/scala/collection/mutable/HashMap.scala b/src/dotnet-library/scala/collection/mutable/HashMap.scala new file mode 100644 index 0000000000..59a8b8a860 --- /dev/null +++ b/src/dotnet-library/scala/collection/mutable/HashMap.scala @@ -0,0 +1,40 @@ +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ + +// $Id$ + + +package scala.collection.mutable + +import Predef._ + +/** This class implements mutable maps using a hashtable. + * + * @author Matthias Zenger + * @author Martin Odersky + * @version 2.0, 31/12/2006 + */ +object HashMap { + + /** The empty map of this type */ + def empty[A, B] = new HashMap[A, B] + + /** The canonical factory for this type + */ + def apply[A, B](elems: {A, B}*) = empty[A, B] ++ elems +} + +[serializable] +class HashMap[A, B] extends Map[A,B] with HashTable[A] with DefaultMapModel[A,B] { + + def -= (key: A) { removeEntry(key) } + + override def clear() = super.clear() + + override def clone(): Map[A, B] = new HashMap[A, B] ++ this +} |