java - Sparse Map with Enum keys -


i need create map enum keys small fraction of enum constants inserted. best approach? enummap inefficient if length of underlying array equal total number of enum constants.

i suggest using ordinary hashmap.

computing hashes enums both easy , cheap. there should no significant memory overhead, since not duplicating enum objects, instead creating multiple references same object. reason, there should little difference between storing integer key , storing reference enum object.


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -