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

COVERAGE SUMMARY FOR SOURCE FILE [SensorsDialogContentProvider.java]

nameclass, %method, %block, %line, %
SensorsDialogContentProvider.java0%   (0/1)0%   (0/5)0%   (0/49)0%   (0/14)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class SensorsDialogContentProvider0%   (0/1)0%   (0/5)0%   (0/49)0%   (0/14)
SensorsDialogContentProvider (): void 0%   (0/1)0%   (0/3)0%   (0/1)
dispose (): void 0%   (0/1)0%   (0/1)0%   (0/1)
getElements (Object): Object [] 0%   (0/1)0%   (0/10)0%   (0/3)
inputChanged (Viewer, Object, Object): void 0%   (0/1)0%   (0/1)0%   (0/1)
sensorsValidation (ConfigEntry): Object [] 0%   (0/1)0%   (0/34)0%   (0/8)

1/**
2 * 
3 */
4package de.uka.ipd.sdq.sensorframework.visualisation.dialogs;
5 
6import java.util.ArrayList;
7import java.util.Collection;
8 
9import org.eclipse.jface.viewers.IStructuredContentProvider;
10import org.eclipse.jface.viewers.Viewer;
11 
12import de.uka.ipd.sdq.sensorframework.entities.ExperimentRun;
13import de.uka.ipd.sdq.sensorframework.entities.Sensor;
14import de.uka.ipd.sdq.sensorframework.visualisation.editor.ConfigEntry;
15import de.uka.ipd.sdq.sensorframework.visualisation.editor.SensorValidationToView;
16 
17/** @author roman */
18public class SensorsDialogContentProvider implements IStructuredContentProvider {
19 
20        Collection<Sensor> sensors;
21        
22        /* (non-Javadoc)
23         * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
24         */
25        public Object[] getElements(Object inputElement) {
26                if (inputElement instanceof ConfigEntry)
27                        return sensorsValidation((ConfigEntry) inputElement);
28                return null;
29        }
30        
31        /**
32         * This function get a sensors list, which can be indicated by
33         * current View.
34         */
35        private Object[] sensorsValidation(ConfigEntry entry) {
36                ExperimentRun run = entry.getExperimentRun();
37                Collection<Sensor> sensors = entry.getExperiment().getSensors();
38                ArrayList<Sensor> validSensors = new ArrayList<Sensor>();
39 
40                for (Sensor sensor : sensors) {
41                        if (SensorValidationToView.canViewSensor(run
42                                        .getMeasurementsOfSensor(sensor)))
43                                validSensors.add(sensor);
44                }
45 
46                return validSensors.toArray();
47        }
48        
49        /* (non-Javadoc)
50         * @see org.eclipse.jface.viewers.IContentProvider#dispose()
51         */
52        public void dispose() {
53                // TODO Auto-generated method stub
54 
55        }
56 
57        /* (non-Javadoc)
58         * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
59         */
60        public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
61                // TODO Auto-generated method stub
62 
63        }
64}

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