Skip to content

Instantly share code, notes, and snippets.

@debasishg
Created November 19, 2010 05:18
Show Gist options
  • Save debasishg/706149 to your computer and use it in GitHub Desktop.
Save debasishg/706149 to your computer and use it in GitHub Desktop.
scala> import collection.mutable._
scala> val m = new HashMap[Int, Set[String]] with MultiMap[Int, String]
m: scala.collection.mutable.HashMap[Int,scala.collection.mutable.Set[String]] with scala.collection.mutable.MultiMap[Int,String] = Map()
scala> m += ((1, Set("rc", "tb")))
res10: m.type = Map((1,Set(tb, rc)))
scala> m += ((2, Set("tb")))
res11: m.type = Map((2,Set(tb)), (1,Set(tb, rc)))
scala> m addBinding(1, "xy")
res12: m.type = Map((2,Set(tb)), (1,Set(tb, rc, xy)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment