1 2 23 24 25 import java.io.*; 26 import java.util.*; 27 28 public class Globals { 29 30 static Hashtable mappings = new Hashtable(); 32 33 static Hashtable mapTargets = new Hashtable(); 35 36 static Hashtable noChangeIds = new Hashtable(); 38 39 static Hashtable useIds = new Hashtable(); 41 42 static File inpDir, outDir; 44 45 static boolean mainExists; 47 48 static String map(String str) { 51 Object obj = mappings.get(str); 52 if (obj != null) { 53 return (String )obj; 54 } 55 if (useIds.isEmpty()) { 56 String newId = "O0" + counter++; 57 mappings.put(str, newId); 58 return newId; 59 } else { 60 obj = useIds.keys().nextElement(); 61 useIds.remove(obj); 62 String newId = (String )obj; 63 mappings.put(str, newId); 64 return newId; 65 } 66 } 67 68 static int counter = 0; 70 71 } 72 | Popular Tags |