Module org.jfree.chart
Package org.jfree.data.gantt
Class TaskSeriesCollection<R extends Comparable<R>,C extends Comparable<C>>
- java.lang.Object
-
- org.jfree.data.general.AbstractDataset
-
- org.jfree.data.general.AbstractSeriesDataset<R>
-
- org.jfree.data.gantt.TaskSeriesCollection<R,C>
-
- All Implemented Interfaces:
ObjectInputValidation,Serializable,Cloneable,EventListener,PublicCloneable,CategoryDataset<R,C>,IntervalCategoryDataset<R,C>,GanttCategoryDataset<R,C>,Dataset,SeriesChangeListener,SeriesDataset<R>,KeyedValues2D<R,C>,Values2D
public class TaskSeriesCollection<R extends Comparable<R>,C extends Comparable<C>> extends AbstractSeriesDataset<R> implements GanttCategoryDataset<R,C>, Cloneable, PublicCloneable, Serializable
A collection ofTaskSeriesobjects. This class provides one implementation of theGanttCategoryDatasetinterface.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TaskSeriesCollection()Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(TaskSeries<R> series)Adds a series to the dataset and sends aDatasetChangeEventto all registered listeners.Objectclone()Returns an independent copy of this dataset.booleanequals(Object obj)Tests this instance for equality with an arbitrary object.intgetColumnCount()Returns the number of column in the dataset.intgetColumnIndex(C columnKey)Returns the column index for a column key.CgetColumnKey(int index)Returns a column key.List<C>getColumnKeys()Returns a list of the column keys in the dataset.NumbergetEndValue(int row, int column)Returns the end value for a task.NumbergetEndValue(int row, int column, int subinterval)Returns the end value of a sub-interval for a given item.NumbergetEndValue(R rowKey, C columnKey)Returns the end value for a task.NumbergetEndValue(R rowKey, C columnKey, int subinterval)Returns the end value of a sub-interval for a given item.NumbergetPercentComplete(int row, int column)Returns the percent complete for a given item.NumbergetPercentComplete(int row, int column, int subinterval)Returns the percentage complete value of a sub-interval for a given item.NumbergetPercentComplete(R rowKey, C columnKey)Returns the percent complete for a given item.NumbergetPercentComplete(R rowKey, C columnKey, int subinterval)Returns the percentage complete value of a sub-interval for a given item.intgetRowCount()Returns the number of rows (series) in the collection.intgetRowIndex(R rowKey)Returns the row index for the given row key.RgetRowKey(int index)Returns the key for a row.List<R>getRowKeys()Returns the row keys.TaskSeries<R>getSeries(int series)Returns a series from the collection.TaskSeries<R>getSeries(R key)Returns a series from the collection.intgetSeriesCount()Returns the number of series in the collection.RgetSeriesKey(int series)Returns the name of a series.NumbergetStartValue(int row, int column)Returns the start value for a task.NumbergetStartValue(int row, int column, int subinterval)Returns the start value of a sub-interval for a given item.NumbergetStartValue(R rowKey, C columnKey)Returns the start value for a task.NumbergetStartValue(R rowKey, C columnKey, int subinterval)Returns the start value of a sub-interval for a given item.intgetSubIntervalCount(int row, int column)Returns the number of sub-intervals for a given item.intgetSubIntervalCount(R rowKey, C columnKey)Returns the number of sub-intervals for a given item.NumbergetValue(int row, int column)Returns the value for a task.NumbergetValue(R rowKey, C columnKey)Returns the value for an item.inthashCode()voidremove(int series)Removes a series from the collection and sends aDatasetChangeEventto all registered listeners.voidremove(TaskSeries<R> series)Removes a series from the collection and sends aDatasetChangeEventto all registered listeners.voidremoveAll()Removes all the series from the collection and sends aDatasetChangeEventto all registered listeners.voidseriesChanged(SeriesChangeEvent event)Called when a series belonging to the dataset changes.-
Methods inherited from class org.jfree.data.general.AbstractSeriesDataset
indexOf
-
Methods inherited from class org.jfree.data.general.AbstractDataset
addChangeListener, fireDatasetChanged, getNotify, hasListener, notifyListeners, removeChangeListener, setNotify, validateObject
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jfree.data.general.Dataset
addChangeListener, removeChangeListener
-
-
-
-
Constructor Detail
-
TaskSeriesCollection
public TaskSeriesCollection()
Default constructor.
-
-
Method Detail
-
getSeries
public TaskSeries<R> getSeries(R key)
Returns a series from the collection.- Parameters:
key- the series key (nullnot permitted).- Returns:
- The series.
- Since:
- 1.0.1
-
getSeries
public TaskSeries<R> getSeries(int series)
Returns a series from the collection.- Parameters:
series- the series index (zero-based).- Returns:
- The series.
- Since:
- 1.0.1
-
getSeriesCount
public int getSeriesCount()
Returns the number of series in the collection.- Specified by:
getSeriesCountin interfaceSeriesDataset<R extends Comparable<R>>- Specified by:
getSeriesCountin classAbstractSeriesDataset<R extends Comparable<R>>- Returns:
- The series count.
-
getSeriesKey
public R getSeriesKey(int series)
Returns the name of a series.- Specified by:
getSeriesKeyin interfaceSeriesDataset<R extends Comparable<R>>- Specified by:
getSeriesKeyin classAbstractSeriesDataset<R extends Comparable<R>>- Parameters:
series- the series index (zero-based).- Returns:
- The name of a series.
-
getRowCount
public int getRowCount()
Returns the number of rows (series) in the collection.- Specified by:
getRowCountin interfaceValues2D- Returns:
- The series count.
-
getRowKeys
public List<R> getRowKeys()
Returns the row keys. In this case, each series is a key.- Specified by:
getRowKeysin interfaceKeyedValues2D<R extends Comparable<R>,C extends Comparable<C>>- Returns:
- The row keys.
-
getColumnCount
public int getColumnCount()
Returns the number of column in the dataset.- Specified by:
getColumnCountin interfaceValues2D- Returns:
- The column count.
-
getColumnKeys
public List<C> getColumnKeys()
Returns a list of the column keys in the dataset.- Specified by:
getColumnKeysin interfaceKeyedValues2D<R extends Comparable<R>,C extends Comparable<C>>- Returns:
- The category list.
-
getColumnKey
public C getColumnKey(int index)
Returns a column key.- Specified by:
getColumnKeyin interfaceKeyedValues2D<R extends Comparable<R>,C extends Comparable<C>>- Parameters:
index- the column index.- Returns:
- The column key.
-
getColumnIndex
public int getColumnIndex(C columnKey)
Returns the column index for a column key.- Specified by:
getColumnIndexin interfaceKeyedValues2D<R extends Comparable<R>,C extends Comparable<C>>- Parameters:
columnKey- the column key (nullnot permitted).- Returns:
- The column index.
-
getRowIndex
public int getRowIndex(R rowKey)
Returns the row index for the given row key.- Specified by:
getRowIndexin interfaceKeyedValues2D<R extends Comparable<R>,C extends Comparable<C>>- Parameters:
rowKey- the row key.- Returns:
- The index.
-
getRowKey
public R getRowKey(int index)
Returns the key for a row.- Specified by:
getRowKeyin interfaceKeyedValues2D<R extends Comparable<R>,C extends Comparable<C>>- Parameters:
index- the row index (zero-based).- Returns:
- The key.
-
add
public void add(TaskSeries<R> series)
Adds a series to the dataset and sends aDatasetChangeEventto all registered listeners.- Parameters:
series- the series (nullnot permitted).
-
remove
public void remove(TaskSeries<R> series)
Removes a series from the collection and sends aDatasetChangeEventto all registered listeners.- Parameters:
series- the series.
-
remove
public void remove(int series)
Removes a series from the collection and sends aDatasetChangeEventto all registered listeners.- Parameters:
series- the series (zero based index).
-
removeAll
public void removeAll()
Removes all the series from the collection and sends aDatasetChangeEventto all registered listeners.
-
getValue
public Number getValue(R rowKey, C columnKey)
Returns the value for an item.- Specified by:
getValuein interfaceKeyedValues2D<R extends Comparable<R>,C extends Comparable<C>>- Parameters:
rowKey- the row key.columnKey- the column key.- Returns:
- The item value.
-
getStartValue
public Number getStartValue(R rowKey, C columnKey)
Returns the start value for a task. This is a date/time value, measured in milliseconds since 1-Jan-1970.- Specified by:
getStartValuein interfaceIntervalCategoryDataset<R extends Comparable<R>,C extends Comparable<C>>- Parameters:
rowKey- the series.columnKey- the category.- Returns:
- The start value (possibly
null). - See Also:
IntervalCategoryDataset.getEndValue(Comparable, Comparable)
-
getStartValue
public Number getStartValue(int row, int column)
Returns the start value for a task.- Specified by:
getStartValuein interfaceIntervalCategoryDataset<R extends Comparable<R>,C extends Comparable<C>>- Parameters:
row- the row index (zero-based).column- the column index (zero-based).- Returns:
- The start value.
- See Also:
IntervalCategoryDataset.getEndValue(int, int)
-
getEndValue
public Number getEndValue(R rowKey, C columnKey)
Returns the end value for a task. This is a date/time value, measured in milliseconds since 1-Jan-1970.- Specified by:
getEndValuein interfaceIntervalCategoryDataset<R extends Comparable<R>,C extends Comparable<C>>- Parameters:
rowKey- the series.columnKey- the category.- Returns:
- The end value (possibly
null). - See Also:
IntervalCategoryDataset.getStartValue(Comparable, Comparable)
-
getEndValue
public Number getEndValue(int row, int column)
Returns the end value for a task.- Specified by:
getEndValuein interfaceIntervalCategoryDataset<R extends Comparable<R>,C extends Comparable<C>>- Parameters:
row- the row index (zero-based).column- the column index (zero-based).- Returns:
- The end value.
- See Also:
IntervalCategoryDataset.getStartValue(int, int)
-
getPercentComplete
public Number getPercentComplete(int row, int column)
Returns the percent complete for a given item.- Specified by:
getPercentCompletein interfaceGanttCategoryDataset<R extends Comparable<R>,C extends Comparable<C>>- Parameters:
row- the row index (zero-based).column- the column index (zero-based).- Returns:
- The percent complete (possibly
null). - See Also:
GanttCategoryDataset.getPercentComplete(Comparable, Comparable)
-
getPercentComplete
public Number getPercentComplete(R rowKey, C columnKey)
Returns the percent complete for a given item.- Specified by:
getPercentCompletein interfaceGanttCategoryDataset<R extends Comparable<R>,C extends Comparable<C>>- Parameters:
rowKey- the row key.columnKey- the column key.- Returns:
- The percent complete.
- See Also:
GanttCategoryDataset.getPercentComplete(int, int)
-
getSubIntervalCount
public int getSubIntervalCount(int row, int column)
Returns the number of sub-intervals for a given item.- Specified by:
getSubIntervalCountin interfaceGanttCategoryDataset<R extends Comparable<R>,C extends Comparable<C>>- Parameters:
row- the row index (zero-based).column- the column index (zero-based).- Returns:
- The sub-interval count.
- See Also:
GanttCategoryDataset.getSubIntervalCount(Comparable, Comparable)
-
getSubIntervalCount
public int getSubIntervalCount(R rowKey, C columnKey)
Returns the number of sub-intervals for a given item.- Specified by:
getSubIntervalCountin interfaceGanttCategoryDataset<R extends Comparable<R>,C extends Comparable<C>>- Parameters:
rowKey- the row key.columnKey- the column key.- Returns:
- The sub-interval count.
- See Also:
GanttCategoryDataset.getSubIntervalCount(int, int)
-
getStartValue
public Number getStartValue(int row, int column, int subinterval)
Returns the start value of a sub-interval for a given item.- Specified by:
getStartValuein interfaceGanttCategoryDataset<R extends Comparable<R>,C extends Comparable<C>>- 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). - See Also:
GanttCategoryDataset.getEndValue(int, int, int)
-
getStartValue
public Number getStartValue(R rowKey, C columnKey, int subinterval)
Returns the start value of a sub-interval for a given item.- Specified by:
getStartValuein interfaceGanttCategoryDataset<R extends Comparable<R>,C extends Comparable<C>>- Parameters:
rowKey- the row key.columnKey- the column key.subinterval- the subinterval.- Returns:
- The start value (possibly
null). - See Also:
GanttCategoryDataset.getEndValue(Comparable, Comparable, int)
-
getEndValue
public Number getEndValue(int row, int column, int subinterval)
Returns the end value of a sub-interval for a given item.- Specified by:
getEndValuein interfaceGanttCategoryDataset<R extends Comparable<R>,C extends Comparable<C>>- Parameters:
row- the row index (zero-based).column- the column index (zero-based).subinterval- the subinterval.- Returns:
- The end value (possibly
null). - See Also:
GanttCategoryDataset.getStartValue(int, int, int)
-
getEndValue
public Number getEndValue(R rowKey, C columnKey, int subinterval)
Returns the end value of a sub-interval for a given item.- Specified by:
getEndValuein interfaceGanttCategoryDataset<R extends Comparable<R>,C extends Comparable<C>>- Parameters:
rowKey- the row key.columnKey- the column key.subinterval- the subinterval.- Returns:
- The end value (possibly
null). - See Also:
GanttCategoryDataset.getStartValue(Comparable, Comparable, int)
-
getPercentComplete
public Number getPercentComplete(int row, int column, int subinterval)
Returns the percentage complete value of a sub-interval for a given item.- Specified by:
getPercentCompletein interfaceGanttCategoryDataset<R extends Comparable<R>,C extends Comparable<C>>- Parameters:
row- the row index (zero-based).column- the column index (zero-based).subinterval- the sub-interval.- Returns:
- The percent complete value (possibly
null). - See Also:
GanttCategoryDataset.getPercentComplete(Comparable, Comparable, int)
-
getPercentComplete
public Number getPercentComplete(R rowKey, C columnKey, int subinterval)
Returns the percentage complete value of a sub-interval for a given item.- Specified by:
getPercentCompletein interfaceGanttCategoryDataset<R extends Comparable<R>,C extends Comparable<C>>- Parameters:
rowKey- the row key.columnKey- the column key.subinterval- the sub-interval.- Returns:
- The percent complete value (possibly
null). - See Also:
GanttCategoryDataset.getPercentComplete(int, int, int)
-
seriesChanged
public void seriesChanged(SeriesChangeEvent event)
Called when a series belonging to the dataset changes.- Specified by:
seriesChangedin interfaceSeriesChangeListener- Overrides:
seriesChangedin classAbstractSeriesDataset<R extends Comparable<R>>- Parameters:
event- information about the change.
-
equals
public boolean equals(Object obj)
Tests this instance for equality with an arbitrary object.
-
clone
public Object clone() throws CloneNotSupportedException
Returns an independent copy of this dataset.- Specified by:
clonein interfacePublicCloneable- Overrides:
clonein classAbstractDataset- Returns:
- A clone of the dataset.
- Throws:
CloneNotSupportedException- if there is some problem cloning the dataset.
-
-