I need a data structure to store string-int value pairs in an 1:1 relationship, and being able too look up from either way their counterpart.
I wrote a class with a
Using Guava,
HashBiMap map = HashBiMap.create(); map.put("name", "Sohail"); map.put("country", "Pakistan"); Log.d("tag", "name is " + map.get("name")); BiMapinvmap= map.inverse(); Log.d("tag", "Pakistan is a " + invmap.get("Pakistan"));
read complete tutorial here.