com.androidplot.data
Class DatasetGroup<BundleType extends DatasetSeriesBundle<DatasetType,DatasetSeriesFormatType>,DatasetType extends Dataset,DatasetSeriesFormatType extends DatasetSeriesFormat>

java.lang.Object
  extended by 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.


Constructor Summary
DatasetGroup()
           
 
Method Summary
 void addDataset(DatasetType dataset, int series, String title, DatasetSeriesFormatType format)
           
 void addListener(DatasetChangeListener listener)
           
 boolean contains(BundleType bundle)
          Tests whether or not the Bundle exists within this DatasetGroup.
 BundleType get(int index)
           
 DatasetType getDataset(int index)
          Convenience method.
 DatasetSeriesFormatType getDatasetFormat(int index)
          Convenience method.
 boolean removeDataset(DatasetType dataset, int series)
           
 boolean removeListener(DatasetChangeListener listener)
           
 int size()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.androidplot.data.DatasetChangeListener
onDatasetChanged
 

Constructor Detail

DatasetGroup

public DatasetGroup()
Method Detail

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.