1 /**
2 * This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 *
6 * If it is not possible or desirable to put the notice in a particular
7 * file, then You may include the notice in a location (such as a LICENSE
8 * file in a relevant directory) where a recipient would be likely to look
9 * for such a notice.
10
11 *
12 */
13
14 /* ---------------------------------------------------------------------------
15 * U.S. Government, Department of the Army
16 * Army Materiel Command
17 * Research Development Engineering Command
18 * Communications Electronics Research Development and Engineering Center
19 * ---------------------------------------------------------------------------
20 */
21
22 package org.miloss.fgsms.services.rs.impl;
23
24 import java.util.ArrayList;
25 import java.util.List;
26 import org.jfree.data.time.TimeSeries;
27
28 /**
29 *Used by the reporting service for generating reports
30 * @author AO
31 */
32 public class TimeSeriesContainer {
33
34 public TimeSeriesContainer() {
35 data = new ArrayList<TimeSeries>();
36 }
37 public List<TimeSeries> data;
38
39 public TimeSeries Get(String name, Class t) {
40 for (int i = 0; i < data.size(); i++) {
41 if (data.get(i).getKey().compareTo(name) == 0) {
42 return data.get(i);
43 }
44 }
45 TimeSeries ts = new TimeSeries(name, t);
46 data.add(ts);
47 return ts;
48 }
49 }