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

COVERAGE SUMMARY FOR SOURCE FILE [DemandTimeReport.java]

nameclass, %method, %block, %line, %
DemandTimeReport.java0%   (0/1)0%   (0/2)0%   (0/64)0%   (0/13)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class DemandTimeReport0%   (0/1)0%   (0/2)0%   (0/64)0%   (0/13)
DemandTimeReport (): void 0%   (0/1)0%   (0/3)0%   (0/1)
prepareReportItems (Collection, RConnection): ArrayList 0%   (0/1)0%   (0/61)0%   (0/12)

1package de.uka.ipd.sdq.sensorframework.visualisation.rvisualisation.reports;
2 
3import java.util.ArrayList;
4import java.util.Collection;
5import java.util.Iterator;
6 
7import de.uka.ipd.sdq.sensorframework.entities.SensorAndMeasurements;
8import de.uka.ipd.sdq.sensorframework.visualisation.rvisualisation.reportitems.IReportItem;
9import de.uka.ipd.sdq.sensorframework.visualisation.rvisualisation.reportitems.RCommandRReportItem;
10import de.uka.ipd.sdq.sensorframework.visualisation.rvisualisation.reportitems.StaticTextReportItem;
11import de.uka.ipd.sdq.sensorframework.visualisation.rvisualisation.utils.RConnection;
12import de.uka.ipd.sdq.sensorframework.visualisation.rvisualisation.utils.REngineHelper;
13 
14/**Report that displays the total resource demands for sensors.
15 * @author groenda
16 */
17public class DemandTimeReport extends RReport {
18 
19        /**Creates a list of summed up resource demands for each registered sensor.
20         * @param c The measurements to sum up.
21         * @param t The connection to the R-Engine.
22         * @return List of items with statistical information.
23         */
24        @Override
25        public ArrayList<IReportItem> prepareReportItems(
26                        final Collection<SensorAndMeasurements> c, final RConnection t) {
27                ArrayList<IReportItem> items = new ArrayList<IReportItem>();
28                items.add(new StaticTextReportItem(
29                                "R-Report about total resource demands", true));
30 
31                Iterator<SensorAndMeasurements> it = c.iterator();
32                for (int i = 0; i < c.size(); i++) {
33                        SensorAndMeasurements sm = it.next();
34                        
35                        String sensorName = REngineHelper.storeMeasurementsInRVector(sm, i, 
36                                        TimeseriesData.TIMESPAN, t);
37                        
38                        String rCommand = "sum(" + sensorName + ")\n";
39                        items.add(new RCommandRReportItem(rCommand, 
40                                        "Resource demand of " + sm.getSensor().getSensorName()));
41                } 
42                return items;
43        }
44}

[all classes][de.uka.ipd.sdq.sensorframework.visualisation.rvisualisation.reports]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov