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? -

java - How to create Table using Apache PDFBox -

mpi - Why is MPI_Bsend not returning error even when the buffer is insufficient to accommodate all the messages -