org.jfree.data
Class TaskSeriesCollection

java.lang.Object
  |
  +--org.jfree.data.AbstractDataset
        |
        +--org.jfree.data.AbstractSeriesDataset
              |
              +--org.jfree.data.TaskSeriesCollection
All Implemented Interfaces:
CategoryDataset, Dataset, IntervalCategoryDataset, KeyedValues2D, MultiIntervalCategoryDataset, java.io.Serializable, SeriesChangeListener, SeriesDataset, Values2D

public class TaskSeriesCollection
extends AbstractSeriesDataset
implements MultiIntervalCategoryDataset

A collection of TaskSeries objects.

This class provides one implementation of the MultiIntervalCategoryDataset interface.

Author:
David Gilbert
See Also:
Serialized Form

Constructor Summary
TaskSeriesCollection()
          Default constructor.
 
Method Summary
 void add(TaskSeries series)
          Adds a series to the dataset.
 int getColumnCount()
          Returns the number of column in the dataset.
 int getColumnIndex(java.lang.Comparable columnKey)
          Returns the column index for a column key.
 java.lang.Comparable getColumnKey(int item)
          Returns a column key.
 java.util.List getColumnKeys()
          Returns a list of the column keys in the dataset.
 java.lang.Number getEndValue(java.lang.Comparable rowKey, java.lang.Comparable columnKey)
          Returns the end value for a task.
 java.lang.Number getEndValue(java.lang.Comparable rowKey, java.lang.Comparable columnKey, int subinterval)
          Returns the end value of a sub-interval for a given item.
 java.lang.Number getEndValue(int row, int column)
          Returns the end value for a task.
 java.lang.Number getEndValue(int row, int column, int subinterval)
          Returns the end value of a sub-interval for a given item.
 int getRowCount()
          Returns the number of rows (series) in the collection.
 int getRowIndex(java.lang.Comparable rowKey)
          Returns the row index for the given row key.
 java.lang.Comparable getRowKey(int index)
          Returns the key for a row.
 java.util.List getRowKeys()
          Returns the row keys.
 int getSeriesCount()
          Returns the number of series in the collection.
 java.lang.String getSeriesName(int series)
          Returns the name of a series.
 java.lang.Number getStartValue(java.lang.Comparable rowKey, java.lang.Comparable columnKey)
          Returns the start value for a task.
 java.lang.Number getStartValue(java.lang.Comparable rowKey, java.lang.Comparable columnKey, int subinterval)
          Returns the start value of a sub-interval for a given item.
 java.lang.Number getStartValue(int row, int column)
          Returns the start value for a task.
 java.lang.Number getStartValue(int row, int column, int subinterval)
          Returns the start value of a sub-interval for a given item.
 int getSubIntervalCount(java.lang.Comparable rowKey, java.lang.Comparable columnKey)
          Returns the number of sub-intervals for a given item.
 int getSubIntervalCount(int row, int column)
          Returns the number of sub-intervals for a given item.
 java.lang.Number getValue(java.lang.Comparable rowKey, java.lang.Comparable columnKey)
          Returns the value for an item.
 java.lang.Number getValue(int row, int column)
          /** Returns the value for a task.
 void remove(int series)
          Removes a series from the collection.
 void remove(TaskSeries series)
          Removes a series from the collection.
 void removeAll()
          Removes all the series from the collection.
 void seriesChanged(SeriesChangeEvent event)
          Called when a series belonging to the dataset changes.
 
Methods inherited from class org.jfree.data.AbstractDataset
addChangeListener, fireDatasetChanged, getGroup, notifyListeners, removeChangeListener, setGroup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jfree.data.Dataset
addChangeListener, getGroup, removeChangeListener, setGroup
 

Constructor Detail

TaskSeriesCollection

public TaskSeriesCollection()
Default constructor.

Method Detail

getSeriesName

public java.lang.String getSeriesName(int series)
Returns the name of a series.

Specified by:
getSeriesName in interface SeriesDataset
Specified by:
getSeriesName in class AbstractSeriesDataset
Parameters:
series - the series index (zero-based).
Returns:
The name of a series.

getSeriesCount

public int getSeriesCount()
Returns the number of series in the collection.

Specified by:
getSeriesCount in interface SeriesDataset
Specified by:
getSeriesCount in class AbstractSeriesDataset
Returns:
the series count.

getRowCount

public int getRowCount()
Returns the number of rows (series) in the collection.

Specified by:
getRowCount in interface Values2D
Returns:
the series count.

getColumnCount

public int getColumnCount()
Returns the number of column in the dataset.

Specified by:
getColumnCount in interface Values2D
Returns:
The column count.

getRowKeys

public java.util.List getRowKeys()
Returns the row keys. In this case, each series is a key.

Specified by:
getRowKeys in interface KeyedValues2D
Returns:
The row keys.

getColumnKeys

public java.util.List getColumnKeys()
Returns a list of the column keys in the dataset.

Specified by:
getColumnKeys in interface KeyedValues2D
Returns:
the category list.

getColumnKey

public java.lang.Comparable getColumnKey(int item)
Returns a column key.

Specified by:
getColumnKey in interface KeyedValues2D
Parameters:
item - the index.
Returns:
The column key.

getColumnIndex

public int getColumnIndex(java.lang.Comparable columnKey)
Returns the column index for a column key.

Specified by:
getColumnIndex in interface KeyedValues2D
Parameters:
columnKey - the columnKey.
Returns:
the column index.

getRowIndex

public int getRowIndex(java.lang.Comparable rowKey)
Returns the row index for the given row key.

Specified by:
getRowIndex in interface KeyedValues2D
Parameters:
rowKey - the row key.
Returns:
The index.

getRowKey

public java.lang.Comparable getRowKey(int index)
Returns the key for a row.

Specified by:
getRowKey in interface KeyedValues2D
Parameters:
index - the row index (zero-based).
Returns:
The key.

add

public void add(TaskSeries series)
Adds a series to the dataset.

Parameters:
series - the series.

remove

public void remove(int series)
Removes a series from the collection.

Notifies all registered listeners that the dataset has changed.

Parameters:
series - the series (zero based index).

remove

public void remove(TaskSeries series)
Removes a series from the collection.

Notifies all registered listeners that the dataset has changed.

Parameters:
series - the series.

removeAll

public void removeAll()
Removes all the series from the collection.

Notifies all registered listeners that the dataset has changed.


getValue

public java.lang.Number getValue(java.lang.Comparable rowKey,
                                 java.lang.Comparable columnKey)
Returns the value for an item.

Specified by:
getValue in interface KeyedValues2D
Parameters:
rowKey - the row key.
columnKey - the column key.
Returns:
The item value.

getValue

public java.lang.Number getValue(int row,
                                 int column)
/** Returns the value for a task.

Specified by:
getValue in interface Values2D
Parameters:
row - the row index (zero-based).
column - the column index (zero-based).
Returns:
the start value.

getStartValue

public java.lang.Number getStartValue(java.lang.Comparable rowKey,
                                      java.lang.Comparable columnKey)
Returns the start value for a task.

Specified by:
getStartValue in interface IntervalCategoryDataset
Parameters:
rowKey - the series.
columnKey - the category.
Returns:
the start value.

getStartValue

public java.lang.Number getStartValue(int row,
                                      int column)
Returns the start value for a task.

Specified by:
getStartValue in interface IntervalCategoryDataset
Parameters:
row - the row index (zero-based).
column - the column index (zero-based).
Returns:
the start value.

getEndValue

public java.lang.Number getEndValue(java.lang.Comparable rowKey,
                                    java.lang.Comparable columnKey)
Returns the end value for a task.

Specified by:
getEndValue in interface IntervalCategoryDataset
Parameters:
rowKey - the series.
columnKey - the category.
Returns:
the end value.

getEndValue

public java.lang.Number getEndValue(int row,
                                    int column)
Returns the end value for a task.

Specified by:
getEndValue in interface IntervalCategoryDataset
Parameters:
row - the row index (zero-based).
column - the column index (zero-based).
Returns:
the end value.

getSubIntervalCount

public int getSubIntervalCount(int row,
                               int column)
Returns the number of sub-intervals for a given item.

Specified by:
getSubIntervalCount in interface MultiIntervalCategoryDataset
Parameters:
row - the row index (zero-based).
column - the column index (zero-based).
Returns:
the sub-interval count.

getSubIntervalCount

public int getSubIntervalCount(java.lang.Comparable rowKey,
                               java.lang.Comparable columnKey)
Returns the number of sub-intervals for a given item.

Specified by:
getSubIntervalCount in interface MultiIntervalCategoryDataset
Parameters:
rowKey - the row key.
columnKey - the column key.
Returns:
the sub-interval count.

getStartValue

public java.lang.Number getStartValue(int row,
                                      int column,
                                      int subinterval)
Returns the start value of a sub-interval for a given item.

Specified by:
getStartValue in interface MultiIntervalCategoryDataset
Parameters:
row - the row index (zero-based).
column - the column index (zero-based).
subinterval - the sub-interval index (zero-based).
Returns:
the start value (possibly null).

getStartValue

public java.lang.Number getStartValue(java.lang.Comparable rowKey,
                                      java.lang.Comparable columnKey,
                                      int subinterval)
Returns the start value of a sub-interval for a given item.

Specified by:
getStartValue in interface MultiIntervalCategoryDataset
Parameters:
rowKey - the row key.
columnKey - the column key.
subinterval - the subinterval.
Returns:
the start value (possibly null).

getEndValue

public java.lang.Number getEndValue(int row,
                                    int column,
                                    int subinterval)
Returns the end value of a sub-interval for a given item.

Specified by:
getEndValue in interface MultiIntervalCategoryDataset
Parameters:
row - the row index (zero-based).
column - the column index (zero-based).
subinterval - the subinterval.
Returns:
the end value (possibly null).

getEndValue

public java.lang.Number getEndValue(java.lang.Comparable rowKey,
                                    java.lang.Comparable columnKey,
                                    int subinterval)
Returns the end value of a sub-interval for a given item.

Specified by:
getEndValue in interface MultiIntervalCategoryDataset
Parameters:
rowKey - the row key.
columnKey - the column key.
subinterval - the subinterval.
Returns:
the end value (possibly null).

seriesChanged

public void seriesChanged(SeriesChangeEvent event)
Called when a series belonging to the dataset changes.

Specified by:
seriesChanged in interface SeriesChangeListener
Overrides:
seriesChanged in class AbstractSeriesDataset
Parameters:
event - information about the change.