Created
October 12, 2015 10:48
-
-
Save frgomes/d26f7e32586a48857910 to your computer and use it in GitHub Desktop.
Scala -- Using multimaps
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.collection.mutable.{ Map, HashMap, Set, MultiMap } | |
// val evictedModuleIDs: Seq[ModuleID] = ... | |
val evicteds: Map[String, Set[ModuleID]] = | |
(new HashMap[String, Set[ModuleID]] with MultiMap[String, ModuleID] /: evictedModuleIDs) { | |
case (acc, m) => | |
val key = s"${m.organization}:${m.name}" | |
acc.addBinding(key, m) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment