EMMA Coverage Report (generated Sun Feb 05 10:43:15 CET 2012)
[all classes][de.uka.ipd.sdq.scheduler.processes.impl]

COVERAGE SUMMARY FOR SOURCE FILE [ProcessRegistry.java]

nameclass, %method, %block, %line, %
ProcessRegistry.java0%   (0/1)0%   (0/7)0%   (0/80)0%   (0/16)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ProcessRegistry0%   (0/1)0%   (0/7)0%   (0/80)0%   (0/16)
<static initializer> 0%   (0/1)0%   (0/8)0%   (0/1)
ProcessRegistry (SimActiveResource): void 0%   (0/1)0%   (0/11)0%   (0/4)
findProcess (String): IActiveProcess 0%   (0/1)0%   (0/35)0%   (0/5)
isRegistered (IActiveProcess): boolean 0%   (0/1)0%   (0/6)0%   (0/1)
lookUp (ISchedulableProcess): IActiveProcess 0%   (0/1)0%   (0/6)0%   (0/1)
registerProcess (IActiveProcess): void 0%   (0/1)0%   (0/8)0%   (0/2)
unregisterProcess (ISchedulableProcess): void 0%   (0/1)0%   (0/6)0%   (0/2)

1package de.uka.ipd.sdq.scheduler.processes.impl;
2 
3import java.util.Hashtable;
4 
5import de.uka.ipd.sdq.scheduler.ISchedulableProcess;
6import de.uka.ipd.sdq.scheduler.processes.IActiveProcess;
7import de.uka.ipd.sdq.scheduler.resources.active.SimActiveResource;
8 
9 
10public class ProcessRegistry {
11        
12        private Hashtable<ISchedulableProcess, IActiveProcess> registry;
13        private SimActiveResource resource;
14        
15        public ProcessRegistry(SimActiveResource resource) {
16                super();
17                this.registry = new Hashtable<ISchedulableProcess, IActiveProcess>();
18                this.resource = resource;
19        }
20 
21        public void registerProcess(IActiveProcess process){
22                registry.put(process.getSchedulableProcess(), process);
23//                process.getSchedulableProcess().setMainResource(resource);
24        }
25        
26        public IActiveProcess lookUp(ISchedulableProcess process){
27                return registry.get(process);
28        }
29        
30        public void unregisterProcess(ISchedulableProcess process){
31                registry.remove(process);
32        }
33 
34        public IActiveProcess findProcess(String processName) {
35                for (IActiveProcess p: registry.values()){
36                        if (p.getName().startsWith(processName))
37                                return p;
38                }
39                assert false : "Cannot find process: " + processName;  
40                return null;
41        }
42 
43        public boolean isRegistered(IActiveProcess p) {
44                return registry.containsKey(p.getSchedulableProcess());
45        }
46        
47}

[all classes][de.uka.ipd.sdq.scheduler.processes.impl]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov