1 18 19 package sync4j.syncclient.common; 20 21 import java.util.Enumeration ; 22 import java.util.HashMap ; 23 import java.util.Hashtable ; 24 25 26 33 34 public class HashtableTools { 35 36 37 39 44 public static HashMap hashtable2hashMap(Hashtable hashtable) { 45 HashMap map = null; 46 if (hashtable == null) { 47 return map; 48 } 49 map = new HashMap (); 50 Enumeration enumKeys = hashtable.keys(); 51 Object key = null; 52 while (enumKeys.hasMoreElements()) { 53 key = enumKeys.nextElement(); 54 map.put(key, hashtable.get(key)); 55 } 56 return map; 57 } 58 } | Popular Tags |