I want to map integers to strings, they are one-to-one such as :
60 : c
61 : c#
62 : d
63 : d#
64 : e
65 : f
66 : f#
But I need to have the ability to do the following :
- Get a value from a key : "c" = getValue(60) [ give it a key 60, return string value ]
- get key from a value : 65 = getKey("f") [ give it a string value "f", return a key ]
Which collection model is best suited for this ? I'm asking because I've looked at several of them, none can do the <2> part. Or do I have to write code to go through every pair to find which key has value "f" ?
Edit : Nothing in jdk1.6 does this ?