hashmap.scala

来自「JAVA 语言的函数式编程扩展」· SCALA 代码 · 共 41 行

SCALA
41
字号
/*                     __                                               *\**     ________ ___   / /  ___     Scala API                            ****    / __/ __// _ | / /  / _ |    (c) 2003-2007, LAMP/EPFL             ****  __\ \/ /__/ __ |/ /__/ __ |    http://scala-lang.org/               **** /____/\___/_/ |_/____/_/ | |                                         ****                          |/                                          **\*                                                                      */// $Id: HashMap.scala 10086 2007-02-21 19:10:41Z odersky $package scala.collection.mutableimport 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}@serializableclass 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}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?