2014. 12. 16. 16:50
프로그래밍/Java
1 2 3 4 5 6 7 8 | public static Object getKeyFromValue(Map hm, Object value) { for (Object o : hm.keySet()) { if (hm.get(o).equals(value)) { return o; } } return null ; } |
출처 : http://www.java2s.com/Code/Java/Collections-Data-Structure/GetakeyfromvaluewithanHashMap.htm