Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why doesn't Google Collections support MultiKeyMap like Apache Collections?

Is the decision by Google similar to the one for SortedMultiSet (stackoverflow question) or is it because there is no use of MultiKeyMap?

I am aware that an alternate for MultiKeyMap can be to use a custom Class as a key which contains the multiple keys as its class members. On the contrary, I like the concept of specifying multiple keys when calling the get of the MultiKeyMap.

Apache's version of MultiKeyMap is great but I'm severely missing Generics and therefore looked into Google Collections for a modern implementation of it. If someone has any idea why Google hasn't supported it yet or there's a better alternative for it then please respond.

like image 490
Monis Iqbal Avatar asked Mar 03 '10 15:03

Monis Iqbal


2 Answers

FYI, the accepted answer was answered in March 2010, but as of September 2010 Guava included Table.

  • Collections explained - Table
  • Tables utility class
  • Table javadoc
like image 142
durron597 Avatar answered Oct 20 '22 16:10

durron597


We have a very nice implementation of a two-tiered map , which we call a "table" (K1 is the "row key" and K2 is the "column key"), and we just haven't gotten it released yet. Past two keys, though, is diminishing returns.

like image 20
Kevin Bourrillion Avatar answered Oct 20 '22 18:10

Kevin Bourrillion