如何清空可变图(由val定义)?

时间:2011-03-03 13:46:22

标签: scala

我为我的对象定义了一个可变属性

object myobject{
  val myMap = mutable.Map[String,mutable.Set[String]]
  def clear {// I don't know what code I must write here for remove all key Values on myMap}
  def add(keyValue:(String,String)){//some code for add a keyValue to mymap}
}

1 个答案:

答案 0 :(得分:16)

查看api docs

myMap.clear