com.jrefinery.data
Class GanttSeriesCollection

java.lang.Object
  extended by com.jrefinery.data.AbstractDataset
      extended by com.jrefinery.data.AbstractSeriesDataset
          extended by com.jrefinery.data.GanttSeriesCollection
All Implemented Interfaces:
CategoryDataset, Dataset, MultiIntervalCategoryDataset, RangeInfo, SeriesChangeListener, SeriesDataset, java.io.Serializable

public class GanttSeriesCollection
extends AbstractSeriesDataset
implements MultiIntervalCategoryDataset, RangeInfo, java.io.Serializable

A collection of GanttSeries objects.

This class provides one implementation of the IntervalCategoryDataset interface. It is sufficient to provide a demonstration of a simple Gantt chart.

See Also:
Serialized Form

Field Summary
protected  java.util.List data
          Storage for the series.
protected  TimeAllocation span
          tracks the minimum and maximum times in agregate task list
protected  java.util.List tasks
          Storage for the aggregate task list.
 
Fields inherited from class com.jrefinery.data.AbstractDataset
listeners
 
Constructor Summary
GanttSeriesCollection()
          Default constructor.
 
Method Summary
 void add(GanttSeries series)
          Adds a series to the dataset.
 void addTask(java.lang.Object name)
           
 void clearSpan()
          Invalidate any previously computed (cached) span be sure to invoke this method after changing TimeAllocations
 java.util.List getCategories()
          Returns a list of the categories in the dataset.
 int getCategoryCount()
          Returns the number of categories in the dataset.
 java.lang.Number getEndValue(int series, java.lang.Object category, int index)
          Returns the max value for the specified series (zero-based index) and category.
 int getIntervalCount(int series, java.lang.Object category)
          Returns the number of TimeIntervals defined for this series/category
 java.lang.Number getMaximumRangeValue()
          Returns the maximum value in the dataset's range (or null if all the values in the range are null).
 java.lang.Number getMinimumRangeValue()
          Returns the minimum value in the dataset's range (or null if all the values in the range are null).
 GanttSeries getSeries(int series)
          method added by Das
 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(int series, java.lang.Object category, int index)
          Returns the min value for the specified series (zero-based index) and category.
 java.lang.Number getValue(int series, java.lang.Object category)
          Required only to satisfy requirements of CategoryDataset interface
 Range getValueRange()
          Returns the range of the values in this dataset's range.
 void removeTask(java.lang.String name)
           
 boolean taskPresent(java.lang.String name)
           
 
Methods inherited from class com.jrefinery.data.AbstractSeriesDataset
getLegendItemCount, getLegendItemLabels, seriesChanged
 
Methods inherited from class com.jrefinery.data.AbstractDataset
addChangeListener, fireDatasetChanged, notifyListeners, removeChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.jrefinery.data.Dataset
addChangeListener, removeChangeListener
 

Field Detail

tasks

protected java.util.List tasks
Storage for the aggregate task list.


data

protected java.util.List data
Storage for the series.


span

protected TimeAllocation span
tracks the minimum and maximum times in agregate task list

Constructor Detail

GanttSeriesCollection

public GanttSeriesCollection()
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 (zero-based index).

getSeries

public GanttSeries getSeries(int series)
method added by Das

Specified by:
getSeries in interface MultiIntervalCategoryDataset

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.

getCategoryCount

public int getCategoryCount()
Returns the number of categories in the dataset.

Specified by:
getCategoryCount in interface CategoryDataset
Returns:
The category count.

getCategories

public java.util.List getCategories()
Returns a list of the categories in the dataset.

Specified by:
getCategories in interface CategoryDataset
Returns:
The category list.

add

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

Specified by:
add in interface MultiIntervalCategoryDataset
Parameters:
series - The series.

getIntervalCount

public int getIntervalCount(int series,
                            java.lang.Object category)
Returns the number of TimeIntervals defined for this series/category

Specified by:
getIntervalCount in interface MultiIntervalCategoryDataset
Parameters:
series - The series index (zero-based).
category - The category.
index - 0 based index into StartValues

getStartValue

public java.lang.Number getStartValue(int series,
                                      java.lang.Object category,
                                      int index)
Returns the min value for the specified series (zero-based index) and category.

Specified by:
getStartValue in interface MultiIntervalCategoryDataset
Parameters:
series - The series index (zero-based).
category - The category.
index - 0 based index into StartValues

getEndValue

public java.lang.Number getEndValue(int series,
                                    java.lang.Object category,
                                    int index)
Returns the max value for the specified series (zero-based index) and category.

Specified by:
getEndValue in interface MultiIntervalCategoryDataset
Parameters:
series - The series index (zero-based).
category - The category.
index - 0 based index into EndValues

getValue

public java.lang.Number getValue(int series,
                                 java.lang.Object category)
Required only to satisfy requirements of CategoryDataset interface

Specified by:
getValue in interface CategoryDataset
Parameters:
series - The series (zero-based index).
category - The category.

clearSpan

public void clearSpan()
Invalidate any previously computed (cached) span be sure to invoke this method after changing TimeAllocations


getMinimumRangeValue

public java.lang.Number getMinimumRangeValue()
Returns the minimum value in the dataset's range (or null if all the values in the range are null).

Specified by:
getMinimumRangeValue in interface RangeInfo
Returns:
The minimum value.

getMaximumRangeValue

public java.lang.Number getMaximumRangeValue()
Returns the maximum value in the dataset's range (or null if all the values in the range are null).

Specified by:
getMaximumRangeValue in interface RangeInfo
Returns:
The maximum value.

getValueRange

public Range getValueRange()
Returns the range of the values in this dataset's range.

Specified by:
getValueRange in interface RangeInfo
Returns:
The range.

removeTask

public void removeTask(java.lang.String name)
Specified by:
removeTask in interface MultiIntervalCategoryDataset

addTask

public void addTask(java.lang.Object name)
Specified by:
addTask in interface MultiIntervalCategoryDataset

taskPresent

public boolean taskPresent(java.lang.String name)
Specified by:
taskPresent in interface MultiIntervalCategoryDataset


Copyright © 2003 MBARI.

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement.