X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=android-libraries%2Fachartengine%2Fsrc%2Forg%2Fachartengine%2Fmodel%2FXYMultipleSeriesDataset.java;fp=android-libraries%2Fachartengine%2Fsrc%2Forg%2Fachartengine%2Fmodel%2FXYMultipleSeriesDataset.java;h=6ac6a6defa3a0fa1780d61e0ef23d18e60f3dddb;hb=dfe153139b917cc91dddc1efa0298d4204616462;hp=0000000000000000000000000000000000000000;hpb=a2fe0ba2c348102bb0c6486b201be097523c2c9a;p=debian%2Fopenrocket diff --git a/android-libraries/achartengine/src/org/achartengine/model/XYMultipleSeriesDataset.java b/android-libraries/achartengine/src/org/achartengine/model/XYMultipleSeriesDataset.java new file mode 100644 index 00000000..6ac6a6de --- /dev/null +++ b/android-libraries/achartengine/src/org/achartengine/model/XYMultipleSeriesDataset.java @@ -0,0 +1,94 @@ +/** + * Copyright (C) 2009 - 2012 SC 4ViewSoft SRL + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.achartengine.model; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * A series that includes 0 to many XYSeries. + */ +public class XYMultipleSeriesDataset implements Serializable { + /** The included series. */ + private List mSeries = new ArrayList(); + + /** + * Adds a new XY series to the list. + * + * @param series the XY series to ass + */ + public synchronized void addSeries(XYSeries series) { + mSeries.add(series); + } + + /** + * Adds a new XY series to the list. + * + * @param index the index in the series list + * @param series the XY series to ass + */ + public synchronized void addSeries(int index, XYSeries series) { + mSeries.add(index, series); + } + + /** + * Removes the XY series from the list. + * + * @param index the index in the series list of the series to remove + */ + public synchronized void removeSeries(int index) { + mSeries.remove(index); + } + + /** + * Removes the XY series from the list. + * + * @param series the XY series to be removed + */ + public synchronized void removeSeries(XYSeries series) { + mSeries.remove(series); + } + + /** + * Returns the XY series at the specified index. + * + * @param index the index + * @return the XY series at the index + */ + public synchronized XYSeries getSeriesAt(int index) { + return mSeries.get(index); + } + + /** + * Returns the XY series count. + * + * @return the XY series count + */ + public synchronized int getSeriesCount() { + return mSeries.size(); + } + + /** + * Returns an array of the XY series. + * + * @return the XY series array + */ + public synchronized XYSeries[] getSeries() { + return mSeries.toArray(new XYSeries[0]); + } + +}