2 * Copyright (C) 2009 - 2012 SC 4ViewSoft SRL
\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
8 * http://www.apache.org/licenses/LICENSE-2.0
\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
16 package org.achartengine.model;
\r
18 import java.io.Serializable;
\r
19 import java.util.ArrayList;
\r
20 import java.util.List;
\r
23 * A series that includes 0 to many XYSeries.
\r
25 public class XYMultipleSeriesDataset implements Serializable {
\r
26 /** The included series. */
\r
27 private List<XYSeries> mSeries = new ArrayList<XYSeries>();
\r
30 * Adds a new XY series to the list.
\r
32 * @param series the XY series to ass
\r
34 public synchronized void addSeries(XYSeries series) {
\r
35 mSeries.add(series);
\r
39 * Adds a new XY series to the list.
\r
41 * @param index the index in the series list
\r
42 * @param series the XY series to ass
\r
44 public synchronized void addSeries(int index, XYSeries series) {
\r
45 mSeries.add(index, series);
\r
49 * Removes the XY series from the list.
\r
51 * @param index the index in the series list of the series to remove
\r
53 public synchronized void removeSeries(int index) {
\r
54 mSeries.remove(index);
\r
58 * Removes the XY series from the list.
\r
60 * @param series the XY series to be removed
\r
62 public synchronized void removeSeries(XYSeries series) {
\r
63 mSeries.remove(series);
\r
67 * Returns the XY series at the specified index.
\r
69 * @param index the index
\r
70 * @return the XY series at the index
\r
72 public synchronized XYSeries getSeriesAt(int index) {
\r
73 return mSeries.get(index);
\r
77 * Returns the XY series count.
\r
79 * @return the XY series count
\r
81 public synchronized int getSeriesCount() {
\r
82 return mSeries.size();
\r
86 * Returns an array of the XY series.
\r
88 * @return the XY series array
\r
90 public synchronized XYSeries[] getSeries() {
\r
91 return mSeries.toArray(new XYSeries[0]);
\r