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

COVERAGE SUMMARY FOR SOURCE FILE [StrategiesRegistry.java]

nameclass, %method, %block, %line, %
StrategiesRegistry.java0%   (0/1)0%   (0/5)0%   (0/58)0%   (0/13)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class StrategiesRegistry0%   (0/1)0%   (0/5)0%   (0/58)0%   (0/13)
<static initializer> 0%   (0/1)0%   (0/12)0%   (0/2)
StrategiesRegistry (): void 0%   (0/1)0%   (0/20)0%   (0/6)
getStrategyFor (ResourceTypeEnum): IDemandStrategy 0%   (0/1)0%   (0/17)0%   (0/2)
registerStrategyFor (ResourceTypeEnum, IDemandStrategy): void 0%   (0/1)0%   (0/7)0%   (0/2)
singleton (): StrategiesRegistry 0%   (0/1)0%   (0/2)0%   (0/1)

1package de.uka.ipd.sdq.prototype.framework.strategies;
2 
3import java.util.HashMap;
4 
5import de.uka.ipd.sdq.measurement.strategies.activeresource.DegreeOfAccuracyEnum;
6import de.uka.ipd.sdq.measurement.strategies.activeresource.IDemandStrategy;
7import de.uka.ipd.sdq.measurement.strategies.activeresource.ResourceTypeEnum;
8import de.uka.ipd.sdq.measurement.strategies.activeresource.cpu.FibonacciDemand;
9 
10public class StrategiesRegistry {
11 
12        private HashMap<ResourceTypeEnum,IDemandStrategy> strategiesHash = new HashMap<ResourceTypeEnum, IDemandStrategy>();
13        private static StrategiesRegistry singletonInstance = new StrategiesRegistry();
14        
15        private StrategiesRegistry() {
16                IDemandStrategy strat = new FibonacciDemand();
17                //TODO: inject the real processing rate
18                strat.initializeStrategy(DegreeOfAccuracyEnum.MEDIUM,1);
19                registerStrategyFor(ResourceTypeEnum.CPU, strat);
20                
21        }
22 
23        public static StrategiesRegistry singleton() {
24                return singletonInstance;
25        }
26        
27        public void registerStrategyFor(ResourceTypeEnum resourceType, IDemandStrategy strategy){
28                strategiesHash.put(resourceType, strategy);
29        }
30        
31        public IDemandStrategy getStrategyFor(ResourceTypeEnum resource) {
32                assert strategiesHash.containsKey(resource);
33                
34                return strategiesHash.get(resource);
35        }
36}

[all classes][de.uka.ipd.sdq.prototype.framework.strategies]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov