Skip to contentPackage: ModMgr
ModMgr
Coverage
      1: package kernelmodules;
2: 
3: import java.util.HashMap;
4: import java.util.Map;
5: 
6: /**
7:  * Managerclass for Modules.
8:  * 
9:  * 
10:  * @author Markus, Hendrik.
11:  */
12: 
13: public final class ModMgr {
14: 
15:         /**
16:          * @param modules
17:          */
18:         private ModMgr() {
19:                 super();
20:                 this.modules = new HashMap<String, Module>();
21:         }
22: 
23:         /**
24:          * theInstance of an ModMgr for the singleton.
25:          */
26:         private static ModMgr instance;
27: 
28:         /**
29:          * @return the PackageManager.
30:          * 
31:          */
32:         public static ModMgr getTheInstance() {
33:•                if (ModMgr.instance == null) {
34: 
35:                         ModMgr.instance = new ModMgr();
36: 
37:                 }
38:                 return instance;
39:         }
40: 
41:         /**
42:          * represents the module.
43:          */
44:         private final Map<String, Module> modules;
45: 
46:         /**
47:          * @return the modules
48:          */
49:         public Map<String, Module> getModules() {
50:                 return this.modules;
51:         }
52: 
53:         /**
54:          * @param module
55:          *            the module to add
56:          */
57:         public void addModule(final Module module) {
58:                 this.modules.put(module.getName(), module);
59:         }
60: }