0

I have to associate an Object to a n keys, such as --> . I am considering using Commons MultiKeyMap or nesting HashMaps (such as Map<K1,Map<K2,Map<K3,O1>>>).

Question: I was wondering which alternative generates the least memory overhead.

Note: I am not particularly concerned about speed of put and get.

k88074
  • 2,042
  • 5
  • 29
  • 43
  • As for Generics, commons collection 4.0 has been around for a while: https://commons.apache.org/proper/commons-collections/javadocs/api-release/org/apache/commons/collections4/map/MultiKeyMap.html Other than that: Why don't you try both variations and take some measurements? – Ray May 05 '15 at 09:00
  • @Ray Thanks for pointing out the new release. I edit the question accordingly. – k88074 May 05 '15 at 09:03

0 Answers0