HashMap Searching For A Specific Value in Multiple Keys

后端 未结 3 1698
别跟我提以往
别跟我提以往 2021-01-29 10:34

I\'m checking to see if a key in my HashMap exists, if it does, I also want to check to see if any other keys have a value with the same name as that of the original key I check

3条回答
  •  太阳男子
    2021-01-29 10:57

    You can have a bi-directional map. E.g. you can have a Map> or MultiMap for the values to keys or you can use a bi-directional map which is planned to be added to Guava.

提交回复
热议问题