01: package test.thread;
02:
03: import java.util.HashMap;
04: import java.util.Map;
05:
06: public class Helper {
07: private static Map<String, Map<Long, Long>> m_maps = new HashMap<String, Map<Long, Long>>();
08:
09: public synchronized static Map<Long, Long> getMap(String className) {
10: Map<Long, Long> result = m_maps.get(className);
11: if (result == null) {
12: result = new HashMap();
13: m_maps.put(className, result);
14: }
15:
16: return result;
17: }
18:
19: public static void reset() {
20: m_maps = new HashMap<String, Map<Long, Long>>();
21: }
22: }
|