1 | package de.uka.ipd.sdq.codegen.simudatavisualisation.datatypes; |
2 | |
3 | import java.util.ArrayList; |
4 | import java.util.List; |
5 | |
6 | public class TimeSeries { |
7 | private String myLabel; |
8 | |
9 | List<TimeSeriesEntity> values = new ArrayList<TimeSeriesEntity>(); |
10 | |
11 | public TimeSeries(String myLabel) { |
12 | super(); |
13 | this.myLabel = myLabel; |
14 | } |
15 | |
16 | public String getLabel() { |
17 | return myLabel; |
18 | } |
19 | |
20 | public void setLabel(String newLabel) { |
21 | myLabel=newLabel; |
22 | } |
23 | |
24 | public List<TimeSeriesEntity> getValues() { |
25 | return values; |
26 | } |
27 | |
28 | public void setValues(List<TimeSeriesEntity> values) { |
29 | this.values = values; |
30 | } |
31 | |
32 | public void add(double x, double y) { |
33 | values.add(new TimeSeriesEntity(x,y)); |
34 | } |
35 | |
36 | @Override |
37 | public String toString() { |
38 | String result = this.myLabel + "\n"; |
39 | for (TimeSeriesEntity e : this.values) { |
40 | result += e + "\n"; |
41 | } |
42 | return result; |
43 | } |
44 | } |