1 | /** |
2 | * |
3 | */ |
4 | package de.uka.ipd.sdq.sensorframework.visualisation.views; |
5 | |
6 | import de.uka.ipd.sdq.sensorframework.entities.Experiment; |
7 | import de.uka.ipd.sdq.sensorframework.entities.ExperimentRun; |
8 | import de.uka.ipd.sdq.sensorframework.entities.Sensor; |
9 | import de.uka.ipd.sdq.sensorframework.entities.dao.IDAOFactory; |
10 | |
11 | /** |
12 | * @author admin |
13 | * |
14 | */ |
15 | public class TreeObject { |
16 | private final Object object; |
17 | private final IDAOFactory datasource; |
18 | private final Experiment experiment; |
19 | private final ExperimentRun run; |
20 | private final boolean isEmpty; |
21 | |
22 | |
23 | /** Experiment Run */ |
24 | public TreeObject(Object object, IDAOFactory datasource, Experiment experiment) { |
25 | this.datasource = datasource; |
26 | this.object = object; |
27 | this.experiment = experiment; |
28 | this.run = null; |
29 | this.isEmpty = true; |
30 | } |
31 | |
32 | /** Sensor*/ |
33 | public TreeObject(Sensor sensor, IDAOFactory datasource, Experiment experiment, ExperimentRun run) { |
34 | this.datasource = datasource; |
35 | this.object = sensor; |
36 | this.experiment = experiment; |
37 | this.run = run; |
38 | this.isEmpty=run.getMeasurementsOfSensor(sensor).getMeasurements().isEmpty(); |
39 | } |
40 | |
41 | public Object getObject() { |
42 | return object; |
43 | } |
44 | |
45 | public Experiment getExperiment() { |
46 | return experiment; |
47 | } |
48 | |
49 | public ExperimentRun getRun() { |
50 | return run; |
51 | } |
52 | |
53 | public IDAOFactory getDatasource() { |
54 | return datasource; |
55 | } |
56 | |
57 | //returns true of the sensor contains measurements |
58 | public boolean isEmpty() { |
59 | return isEmpty; |
60 | } |
61 | } |