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

COVERAGE SUMMARY FOR SOURCE FILE [TakeScheduledResourceDemandStrategy.java]

nameclass, %method, %block, %line, %
TakeScheduledResourceDemandStrategy.java0%   (0/1)0%   (0/2)0%   (0/48)0%   (0/11)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class TakeScheduledResourceDemandStrategy0%   (0/1)0%   (0/2)0%   (0/48)0%   (0/11)
TakeScheduledResourceDemandStrategy (): void 0%   (0/1)0%   (0/3)0%   (0/1)
takeSample (String, Object []): ProbeSample 0%   (0/1)0%   (0/45)0%   (0/10)

1package de.uka.ipd.sdq.simucomframework.probes;
2 
3import javax.measure.Measure;
4import javax.measure.quantity.Duration;
5import javax.measure.unit.SI;
6 
7import de.uka.ipd.sdq.probespec.framework.ProbeSample;
8import de.uka.ipd.sdq.probespec.framework.ProbeType;
9import de.uka.ipd.sdq.probespec.framework.probes.IProbeStrategy;
10import de.uka.ipd.sdq.simucomframework.resources.ScheduledResource;
11 
12/**
13 * ProbeStrategy which is able to measure the demanded time of a
14 * {@link ScheduledResource}. The unit is assumed to be
15 * {@link SI#SECOND}.
16 *
17 * @author Philipp Merkle
18 *
19 */
20public class TakeScheduledResourceDemandStrategy implements IProbeStrategy {
21 
22        /**
23         * @param o
24         *            expects a {@link Double} that represents the demand
25         */
26        public ProbeSample<Double, Duration> takeSample(String probeId, Object... o) {
27                Double demand = null;
28                if (o.length >= 1 && o[0] instanceof Double) {
29                        demand = (Double) o[0];
30                } else {
31                        throw new IllegalArgumentException("Expected an argument of type "
32                                        + Double.class.getSimpleName() + ".");
33                }
34 
35                // Here it is assumed that the simulation time's unit is SI.SECOND
36                Measure<Double, Duration> demandMeasure = Measure.valueOf(demand,
37                                SI.SECOND);
38                ProbeSample<Double, Duration> sample = new ProbeSample<Double, Duration>(
39                                demandMeasure, probeId, ProbeType.RESOURCE_DEMAND);
40 
41                return sample;
42        }
43 
44}

[all classes][de.uka.ipd.sdq.simucomframework.probes]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov