Is there such a thing as bidirectional maps in Scala?
问题 I'd like to link 2 columns of unique identifiers and be able to get a first column value by a second column value as well as a second column value by a first column value. Something like Map(1 <-> "one", 2 <-> "two", 3 <-> "three") Is there such a facility in Scala? Actually I need even more: 3 columns to select any in a triplet by another in a triplet (individual values will never be met more than once in the entire map). But a 2-column bidirectional map can help too. 回答1: Guava has a bimap