I currently have a variable that looks like this:
val someVal = new HashMap[Float, Set[String]] with MultiMap[Float, String]
Now I would like to have a hash of these hashes of the form:
val someHashOfSomeVal = new HashMap[String, HashMap[Float, Set[String]] with MultiMap[Float, String]]
In other words, I need to have a hash table (with multiple values for each key) of hash tables (with multiple values of each key). Can anyone help me with how I declare / mutate this variable?
Do I mutate it like this?someHashOfSomeVal.addBinding("someKey", someVal)
It’s unclear to me why you’d want the top-level map to have multiple values (other maps, in this case) per key, or how that would work in practice. I’ll assume that you only want
MultiMapat the lower level, in which case you can use the following approach:Which prints
Set(c), as you’d expect.