搜索地图
//package com.nowjava; /*from N o w J a v a . c o m - 时 代 Java*/ import java.util.Iterator; import java.util.Map; public class Main { public static String searchMap(Map hm, String searchFor) { Iterator i = hm.entrySet().iterator(); String newName = null; while (i.hasNext()) { Map.Entry entry = (Map.Entry) i.next(); String key = (String) entry.getKey(); String value = (String) entry.getValue(); if (key.equals(searchFor)) {//nowjava.com - 时 代 Java 提 供 newName = value; }