1 package csdl.jblanket.methodset; 2 3 import java.util.HashMap ; 4 import java.util.Map ; 5 6 14 public class MethodSetManager { 15 16 17 private static MethodSetManager theInstance = null; 18 19 20 private Map managerMap; 21 22 25 private MethodSetManager() { 26 this.managerMap = new HashMap (); 27 } 28 29 34 public static synchronized MethodSetManager getInstance() { 35 36 if (MethodSetManager.theInstance == null) { 37 MethodSetManager.theInstance = new MethodSetManager(); 38 } 39 40 return MethodSetManager.theInstance; 41 } 42 43 51 public MethodSet getMethodSet(String fileName) { 52 MethodSet methodSet = (MethodSet) this.managerMap.get(fileName); 53 54 if (methodSet == null) { 55 methodSet = new MethodSet(); 56 this.managerMap.put(fileName, methodSet); 57 } 58 59 return methodSet; 60 } 61 } 62 | Popular Tags |