com.androidplot.data
Class DatasetGroup<BundleType extends DatasetSeriesBundle<DatasetType,DatasetSeriesFormatType>,DatasetType extends Dataset,DatasetSeriesFormatType extends DatasetSeriesFormat>
java.lang.Object
com.androidplot.data.DatasetGroup<BundleType,DatasetType,DatasetSeriesFormatType>
- All Implemented Interfaces:
- DatasetChangeListener
- Direct Known Subclasses:
- XYDatasetGroup
public abstract class DatasetGroup<BundleType extends DatasetSeriesBundle<DatasetType,DatasetSeriesFormatType>,DatasetType extends Dataset,DatasetSeriesFormatType extends DatasetSeriesFormat>
- extends Object
- implements DatasetChangeListener
Manages a List of DatasetSeriesBundle instances to be drawn by a Plot.
DatasetGroup
public DatasetGroup()
contains
public boolean contains(BundleType bundle)
- Tests whether or not the Bundle exists within this DatasetGroup.
- Parameters:
bundle
- The Bundle to look for
- Returns:
- True if a DatasetSeriesBundle exists within this DatasetGroup whose Dataset equals bundle's AND
whose series equals bundle's. Returns false otherwise.
size
public int size()
- Returns:
- The number of bundles currently contained within the DatasetGroup.
addDataset
public void addDataset(DatasetType dataset,
int series,
String title,
DatasetSeriesFormatType format)
- Parameters:
dataset
- The Dataset containing the series to be associated.series
- The series to be associated.title
- Title of this series within the Plot.format
- Formatting to be applied to the series when it is drawn.
removeDataset
public boolean removeDataset(DatasetType dataset,
int series)
- Parameters:
dataset
- The Dataset containing the series to be removed.series
- The series to be removed.
- Returns:
- True if the dataset was found and successfully removed, false otherwise.
addListener
public void addListener(DatasetChangeListener listener)
- Parameters:
listener
- Listener to be added.
removeListener
public boolean removeListener(DatasetChangeListener listener)
- Parameters:
listener
- Listener to be removed.
- Returns:
- True if the Listener was found and successfully removed, false otherwise.
get
public BundleType get(int index)
- Parameters:
index
- The index of the Bundle to be retrieved.
- Returns:
- The bundle at index.
getDataset
public DatasetType getDataset(int index)
- Convenience method.
- Parameters:
index
-
- Returns:
-
- Throws:
IndexOutOfBoundsException
getDatasetFormat
public DatasetSeriesFormatType getDatasetFormat(int index)
- Convenience method.
- Parameters:
index
-
- Returns:
Copyright © 2010. All Rights Reserved.