Amir Esmaeilzadeh
Amir Esmaeilzadeh

Reputation: 1342

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

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}
}

Upvotes: 11

Views: 6774

Answers (1)

Martin Ring
Martin Ring

Reputation: 5426

Have a look in the api docs!

myMap.clear()

Upvotes: 23

Related Questions