create changelog entry
[debian/openrocket] / android-libraries / achartengine / src / org / achartengine / model / XYMultipleSeriesDataset.java
1 /**\r
2  * Copyright (C) 2009 - 2012 SC 4ViewSoft SRL\r
3  *  \r
4  * Licensed under the Apache License, Version 2.0 (the "License");\r
5  * you may not use this file except in compliance with the License.\r
6  * You may obtain a copy of the License at\r
7  *  \r
8  *      http://www.apache.org/licenses/LICENSE-2.0\r
9  *  \r
10  * Unless required by applicable law or agreed to in writing, software\r
11  * distributed under the License is distributed on an "AS IS" BASIS,\r
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
13  * See the License for the specific language governing permissions and\r
14  * limitations under the License.\r
15  */\r
16 package org.achartengine.model;\r
17 \r
18 import java.io.Serializable;\r
19 import java.util.ArrayList;\r
20 import java.util.List;\r
21 \r
22 /**\r
23  * A series that includes 0 to many XYSeries.\r
24  */\r
25 public class XYMultipleSeriesDataset implements Serializable {\r
26   /** The included series. */\r
27   private List<XYSeries> mSeries = new ArrayList<XYSeries>();\r
28 \r
29   /**\r
30    * Adds a new XY series to the list.\r
31    * \r
32    * @param series the XY series to ass\r
33    */\r
34   public synchronized void addSeries(XYSeries series) {\r
35     mSeries.add(series);\r
36   }\r
37 \r
38   /**\r
39    * Adds a new XY series to the list.\r
40    * \r
41    * @param index the index in the series list\r
42    * @param series the XY series to ass\r
43    */\r
44   public synchronized void addSeries(int index, XYSeries series) {\r
45     mSeries.add(index, series);\r
46   }\r
47 \r
48   /**\r
49    * Removes the XY series from the list.\r
50    * \r
51    * @param index the index in the series list of the series to remove\r
52    */\r
53   public synchronized void removeSeries(int index) {\r
54     mSeries.remove(index);\r
55   }\r
56 \r
57   /**\r
58    * Removes the XY series from the list.\r
59    * \r
60    * @param series the XY series to be removed\r
61    */\r
62   public synchronized void removeSeries(XYSeries series) {\r
63     mSeries.remove(series);\r
64   }\r
65 \r
66   /**\r
67    * Returns the XY series at the specified index.\r
68    * \r
69    * @param index the index\r
70    * @return the XY series at the index\r
71    */\r
72   public synchronized XYSeries getSeriesAt(int index) {\r
73     return mSeries.get(index);\r
74   }\r
75 \r
76   /**\r
77    * Returns the XY series count.\r
78    * \r
79    * @return the XY series count\r
80    */\r
81   public synchronized int getSeriesCount() {\r
82     return mSeries.size();\r
83   }\r
84 \r
85   /**\r
86    * Returns an array of the XY series.\r
87    * \r
88    * @return the XY series array\r
89    */\r
90   public synchronized XYSeries[] getSeries() {\r
91     return mSeries.toArray(new XYSeries[0]);\r
92   }\r
93 \r
94 }\r