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

COVERAGE SUMMARY FOR SOURCE FILE [SimuComExperimentRunDecorator.java]

nameclass, %method, %block, %line, %
SimuComExperimentRunDecorator.java0%   (0/3)0%   (0/21)0%   (0/195)0%   (0/64)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class SimuComExperimentRunDecorator0%   (0/1)0%   (0/13)0%   (0/150)0%   (0/47)
SimuComExperimentRunDecorator (SimuComModel, ExperimentRun): void 0%   (0/1)0%   (0/12)0%   (0/5)
addMeasurement (Measurement): void 0%   (0/1)0%   (0/15)0%   (0/5)
addScalabilityMeasurement (ScalabilitySensor, Double [], double): Scalability... 0%   (0/1)0%   (0/21)0%   (0/7)
addStateMeasurement (StateSensor, State, double): StateMeasurement 0%   (0/1)0%   (0/14)0%   (0/5)
addStateMeasurementAfterRun (StateSensor, State, double): StateMeasurement 0%   (0/1)0%   (0/14)0%   (0/5)
addTimeSpanMeasurement (TimeSpanSensor, double, double): TimeSpanMeasurement 0%   (0/1)0%   (0/27)0%   (0/7)
addTimeSpanMeasurementAfterRun (TimeSpanSensor, double, double): TimeSpanMeas... 0%   (0/1)0%   (0/20)0%   (0/5)
getExperimentDateTime (): String 0%   (0/1)0%   (0/4)0%   (0/1)
getExperimentRunID (): long 0%   (0/1)0%   (0/4)0%   (0/1)
getMeasurements (): Collection 0%   (0/1)0%   (0/4)0%   (0/1)
getMeasurementsOfSensor (Sensor): SensorAndMeasurements 0%   (0/1)0%   (0/5)0%   (0/1)
setExperimentDateTime (String): void 0%   (0/1)0%   (0/5)0%   (0/2)
setExperimentRunID (long): void 0%   (0/1)0%   (0/5)0%   (0/2)
     
class SimuComExperimentRunDecorator$DecoratorMeasurement0%   (0/1)0%   (0/5)0%   (0/26)0%   (0/10)
SimuComExperimentRunDecorator$DecoratorMeasurement (SimuComExperimentRunDecor... 0%   (0/1)0%   (0/12)0%   (0/4)
getEventTime (): double 0%   (0/1)0%   (0/3)0%   (0/1)
getSensor (): Sensor 0%   (0/1)0%   (0/3)0%   (0/1)
setEventTime (double): void 0%   (0/1)0%   (0/4)0%   (0/2)
setSensor (Sensor): void 0%   (0/1)0%   (0/4)0%   (0/2)
     
class SimuComExperimentRunDecorator$DecoratorTimeSpanMeasurement0%   (0/1)0%   (0/3)0%   (0/19)0%   (0/7)
SimuComExperimentRunDecorator$DecoratorTimeSpanMeasurement (SimuComExperiment... 0%   (0/1)0%   (0/12)0%   (0/4)
getTimeSpan (): double 0%   (0/1)0%   (0/3)0%   (0/1)
setTimeSpan (double): void 0%   (0/1)0%   (0/4)0%   (0/2)

1package de.uka.ipd.sdq.simucomframework.sensors;
2 
3import java.util.Collection;
4import java.util.Observable;
5 
6import de.uka.ipd.sdq.sensorframework.entities.ExperimentRun;
7import de.uka.ipd.sdq.sensorframework.entities.Measurement;
8import de.uka.ipd.sdq.sensorframework.entities.ScalabilityMeasurement;
9import de.uka.ipd.sdq.sensorframework.entities.ScalabilitySensor;
10import de.uka.ipd.sdq.sensorframework.entities.Sensor;
11import de.uka.ipd.sdq.sensorframework.entities.SensorAndMeasurements;
12import de.uka.ipd.sdq.sensorframework.entities.State;
13import de.uka.ipd.sdq.sensorframework.entities.StateMeasurement;
14import de.uka.ipd.sdq.sensorframework.entities.StateSensor;
15import de.uka.ipd.sdq.sensorframework.entities.TimeSpanMeasurement;
16import de.uka.ipd.sdq.sensorframework.entities.TimeSpanSensor;
17import de.uka.ipd.sdq.simucomframework.model.SimuComModel;
18 
19@Deprecated
20public class SimuComExperimentRunDecorator extends Observable implements
21                ExperimentRun {
22 
23        private ExperimentRun decoratedRun = null;
24        private SimuComModel model;
25 
26        public SimuComExperimentRunDecorator(SimuComModel simuComModel,
27                        ExperimentRun experimentRun) {
28                this.model = simuComModel;
29                this.decoratedRun = experimentRun;
30        }
31 
32        public void addMeasurement(Measurement arg0) {
33                if (model.getSimulationControl().isRunning()) {
34                        setChanged();
35                        notifyObservers(arg0);
36                        decoratedRun.addMeasurement(arg0);
37                }
38        }
39 
40        public StateMeasurement addStateMeasurement(StateSensor arg0, State arg1,
41                        double arg2) {
42                // Hauck:
43                // Changed behaviour here in order to allow adding states after
44                // simulation has stopped. This is necessary for the OverallUtlilisationSensor
45                
46                //if (model.getSimulationControl().isRunning()) {
47                        StateMeasurement measurement = decoratedRun.addStateMeasurement(
48                                        arg0, arg1, arg2);
49                        setChanged();
50                        notifyObservers(measurement);
51                        return measurement;
52                //} else
53                        //return null;
54        }
55 
56        public TimeSpanMeasurement addTimeSpanMeasurement(TimeSpanSensor arg0,
57                        double arg1, double arg2) {
58                if (model.getSimulationControl().isRunning()) {
59                        TimeSpanMeasurement measurement = decoratedRun
60                                        .addTimeSpanMeasurement(arg0, arg1, arg2);
61                        setChanged();
62                        notifyObservers(new DecoratorTimeSpanMeasurement(arg0, arg1, arg2));
63                        return measurement;
64                } else
65                        return null;
66        }
67 
68        public StateMeasurement addStateMeasurementAfterRun(StateSensor arg0,
69                        State arg1, double arg2) {
70                StateMeasurement measurement = decoratedRun.addStateMeasurement(arg0,
71                                arg1, arg2);
72                setChanged();
73                notifyObservers(measurement);
74                return measurement;
75        }
76 
77        public TimeSpanMeasurement addTimeSpanMeasurementAfterRun(
78                        TimeSpanSensor sensor, double eventtime, double timespan) {
79                TimeSpanMeasurement measurement = decoratedRun.addTimeSpanMeasurement(
80                                sensor, eventtime, timespan);
81                setChanged();
82                notifyObservers(new DecoratorTimeSpanMeasurement(sensor, eventtime, timespan));
83                return measurement;
84        }
85 
86        public ScalabilityMeasurement addScalabilityMeasurement(
87                        ScalabilitySensor arg0, Double[] arg1, double arg2) {
88                if (model.getSimulationControl().isRunning()) {
89                        ScalabilityMeasurement measurement = decoratedRun
90                                        .addScalabilityMeasurement(arg0, arg1, arg2);
91                        setChanged();
92                        notifyObservers(measurement);
93                        return measurement;
94                } else
95                        return null;
96        }
97 
98        public String getExperimentDateTime() {
99                return decoratedRun.getExperimentDateTime();
100        }
101 
102        public long getExperimentRunID() {
103                return decoratedRun.getExperimentRunID();
104        }
105 
106        public Collection<Measurement> getMeasurements() {
107                return decoratedRun.getMeasurements();
108        }
109 
110        public SensorAndMeasurements getMeasurementsOfSensor(Sensor arg0) {
111                return decoratedRun.getMeasurementsOfSensor(arg0);
112        }
113 
114        public void setExperimentDateTime(String arg0) {
115                decoratedRun.setExperimentDateTime(arg0);
116        }
117 
118        public void setExperimentRunID(long arg0) {
119                decoratedRun.setExperimentRunID(arg0);
120        }
121 
122        public class DecoratorMeasurement {
123 
124                protected double eventTime;
125 
126                protected Sensor sensor;
127 
128                public DecoratorMeasurement(Sensor sensor, double eventTime) {
129                        this.eventTime = eventTime;
130                        this.sensor = sensor;
131                }
132 
133                public double getEventTime() {
134                        return eventTime;
135                }
136 
137                public void setEventTime(double eventTime) {
138                        this.eventTime = eventTime;
139                }
140 
141                public Sensor getSensor() {
142                        return sensor;
143                }
144 
145                public void setSensor(Sensor sensor) {
146                        this.sensor = sensor;
147                }
148 
149        }
150 
151        public class DecoratorTimeSpanMeasurement extends DecoratorMeasurement {
152 
153                private double timeSpan;
154 
155                public DecoratorTimeSpanMeasurement(Sensor sensor, double eventTime,
156                                double timeSpan) {
157                        super(sensor, eventTime);
158                        this.timeSpan = timeSpan;
159                }
160 
161                public double getTimeSpan() {
162                        return timeSpan;
163                }
164 
165                public void setTimeSpan(double timeSpan) {
166                        this.timeSpan = timeSpan;
167                }
168 
169        }
170 
171}

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