Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how can I empty a mutable map (defined by val)?

Tags:

scala

I define a mutable property for my object

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}
}
like image 529
Mohammad Reza Esmaeilzadeh Avatar asked Mar 03 '11 13:03

Mohammad Reza Esmaeilzadeh


1 Answers

Have a look in the api docs!

myMap.clear()
like image 173
Martin Ring Avatar answered Oct 20 '22 14:10

Martin Ring