Package org.jfree.data.gantt
Class TaskSeriesCollection
- java.lang.Object
-
- org.jfree.data.general.AbstractDataset
-
- org.jfree.data.general.AbstractSeriesDataset
-
- org.jfree.data.gantt.TaskSeriesCollection
-
- All Implemented Interfaces:
java.io.ObjectInputValidation,java.io.Serializable,java.lang.Cloneable,java.util.EventListener,PublicCloneable,CategoryDataset,IntervalCategoryDataset,GanttCategoryDataset,Dataset,SeriesChangeListener,SeriesDataset,KeyedValues2D,Values2D
public class TaskSeriesCollection extends AbstractSeriesDataset implements GanttCategoryDataset, java.lang.Cloneable, PublicCloneable, java.io.Serializable
A collection ofTaskSeriesobjects. This class provides one implementation of theGanttCategoryDatasetinterface.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.ListdataStorage for the series.private java.util.ListkeysStorage for aggregate task keys (the task description is used as the key).private static longserialVersionUIDFor serialization.
-
Constructor Summary
Constructors Constructor Description TaskSeriesCollection()Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(TaskSeries series)Adds a series to the dataset and sends aDatasetChangeEventto all registered listeners.booleancanEqual(java.lang.Object other)Ensures symmetry between super/subclass implementations of equals.java.lang.Objectclone()Returns an independent copy of this dataset.booleanequals(java.lang.Object obj)Tests this instance for equality with an arbitrary object.intgetColumnCount()Returns the number of column in the dataset.intgetColumnIndex(java.lang.Comparable columnKey)Returns the column index for a column key.java.lang.ComparablegetColumnKey(int index)Returns a column key.java.util.ListgetColumnKeys()Returns a list of the column keys in the dataset.java.lang.NumbergetEndValue(int row, int column)Returns the end value for a task.java.lang.NumbergetEndValue(int row, int column, int subinterval)Returns the end value of a sub-interval for a given item.java.lang.NumbergetEndValue(java.lang.Comparable rowKey, java.lang.Comparable columnKey)Returns the end value for a task.java.lang.NumbergetEndValue(java.lang.Comparable rowKey, java.lang.Comparable columnKey, int subinterval)Returns the end value of a sub-interval for a given item.java.lang.NumbergetPercentComplete(int row, int column)Returns the percent complete for a given item.java.lang.NumbergetPercentComplete(int row, int column, int subinterval)Returns the percentage complete value of a sub-interval for a given item.java.lang.NumbergetPercentComplete(java.lang.Comparable rowKey, java.lang.Comparable columnKey)Returns the percent complete for a given item.java.lang.NumbergetPercentComplete(java.lang.Comparable rowKey, java.lang.Comparable 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(java.lang.Comparable rowKey)Returns the row index for the given row key.java.lang.ComparablegetRowKey(int index)Returns the key for a row.java.util.ListgetRowKeys()Returns the row keys.TaskSeriesgetSeries(int series)Returns a series from the collection.TaskSeriesgetSeries(java.lang.Comparable key)Returns a series from the collection.intgetSeriesCount()Returns the number of series in the collection.java.lang.ComparablegetSeriesKey(int series)Returns the name of a series.java.lang.NumbergetStartValue(int row, int column)Returns the start value for a task.java.lang.NumbergetStartValue(int row, int column, int subinterval)Returns the start value of a sub-interval for a given item.java.lang.NumbergetStartValue(java.lang.Comparable rowKey, java.lang.Comparable columnKey)Returns the start value for a task.java.lang.NumbergetStartValue(java.lang.Comparable rowKey, java.lang.Comparable 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(java.lang.Comparable rowKey, java.lang.Comparable columnKey)Returns the number of sub-intervals for a given item.java.lang.NumbergetValue(int row, int column)Returns the value for a task.java.lang.NumbergetValue(java.lang.Comparable rowKey, java.lang.Comparable columnKey)Returns the value for an item.inthashCode()private voidreadObject(java.io.ObjectInputStream stream)Provides serialization support.private voidrefreshKeys()Refreshes the keys.voidremove(int series)Removes a series from the collection and sends aDatasetChangeEventto all registered listeners.voidremove(TaskSeries 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.private voidwriteObject(java.io.ObjectOutputStream stream)Provides serialization support.-
Methods inherited from class org.jfree.data.general.AbstractSeriesDataset
indexOf
-
Methods inherited from class org.jfree.data.general.AbstractDataset
addChangeListener, fireDatasetChanged, getGroup, getNotify, hasListener, notifyListeners, removeChangeListener, setGroup, 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, getGroup, removeChangeListener, setGroup
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
For serialization.- See Also:
- Constant Field Values
-
keys
private java.util.List keys
Storage for aggregate task keys (the task description is used as the key).
-
data
private java.util.List data
Storage for the series.
-
-
Method Detail
-
getSeries
public TaskSeries getSeries(java.lang.Comparable key)
Returns a series from the collection.- Parameters:
key- the series key (nullnot permitted).- Returns:
- The series.
-
getSeries
public TaskSeries getSeries(int series)
Returns a series from the collection.- Parameters:
series- the series index (zero-based).- Returns:
- The series.
-
getSeriesCount
public int getSeriesCount()
Returns the number of series in the collection.- Specified by:
getSeriesCountin interfaceSeriesDataset- Specified by:
getSeriesCountin classAbstractSeriesDataset- Returns:
- The series count.
-
getSeriesKey
public java.lang.Comparable getSeriesKey(int series)
Returns the name of a series.- Specified by:
getSeriesKeyin interfaceSeriesDataset- Specified by:
getSeriesKeyin classAbstractSeriesDataset- 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 java.util.List getRowKeys()
Returns the row keys. In this case, each series is a key.- Specified by:
getRowKeysin interfaceKeyedValues2D- 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 java.util.List getColumnKeys()
Returns a list of the column keys in the dataset.- Specified by:
getColumnKeysin interfaceKeyedValues2D- Returns:
- The category list.
-
getColumnKey
public java.lang.Comparable getColumnKey(int index)
Returns a column key.- Specified by:
getColumnKeyin interfaceKeyedValues2D- Parameters:
index- the column index.- Returns:
- The column key.
-
getColumnIndex
public int getColumnIndex(java.lang.Comparable columnKey)
Returns the column index for a column key.- Specified by:
getColumnIndexin interfaceKeyedValues2D- Parameters:
columnKey- the column key (nullnot permitted).- Returns:
- The column index.
-
getRowIndex
public int getRowIndex(java.lang.Comparable rowKey)
Returns the row index for the given row key.- Specified by:
getRowIndexin interfaceKeyedValues2D- Parameters:
rowKey- the row key.- Returns:
- The index.
-
getRowKey
public java.lang.Comparable getRowKey(int index)
Returns the key for a row.- Specified by:
getRowKeyin interfaceKeyedValues2D- Parameters:
index- the row index (zero-based).- Returns:
- The key.
-
add
public void add(TaskSeries series)
Adds a series to the dataset and sends aDatasetChangeEventto all registered listeners.- Parameters:
series- the series (nullnot permitted).
-
remove
public void remove(TaskSeries 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 java.lang.Number getValue(java.lang.Comparable rowKey, java.lang.Comparable columnKey)Returns the value for an item.- Specified by:
getValuein interfaceKeyedValues2D- 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.
-
getStartValue
public java.lang.Number getStartValue(java.lang.Comparable rowKey, java.lang.Comparable 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- Parameters:
rowKey- the series.columnKey- the category.- Returns:
- The start value (possibly
null). - See Also:
IntervalCategoryDataset.getEndValue(Comparable, Comparable)
-
getStartValue
public java.lang.Number getStartValue(int row, int column)Returns the start value for a task.- Specified by:
getStartValuein interfaceIntervalCategoryDataset- 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 java.lang.Number getEndValue(java.lang.Comparable rowKey, java.lang.Comparable 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- Parameters:
rowKey- the series.columnKey- the category.- Returns:
- The end value (possibly
null). - See Also:
IntervalCategoryDataset.getStartValue(Comparable, Comparable)
-
getEndValue
public java.lang.Number getEndValue(int row, int column)Returns the end value for a task.- Specified by:
getEndValuein interfaceIntervalCategoryDataset- 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 java.lang.Number getPercentComplete(int row, int column)Returns the percent complete for a given item.- Specified by:
getPercentCompletein interfaceGanttCategoryDataset- 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 java.lang.Number getPercentComplete(java.lang.Comparable rowKey, java.lang.Comparable columnKey)Returns the percent complete for a given item.- Specified by:
getPercentCompletein interfaceGanttCategoryDataset- 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- 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(java.lang.Comparable rowKey, java.lang.Comparable columnKey)Returns the number of sub-intervals for a given item.- Specified by:
getSubIntervalCountin interfaceGanttCategoryDataset- Parameters:
rowKey- the row key.columnKey- the column key.- Returns:
- The sub-interval count.
- See Also:
GanttCategoryDataset.getSubIntervalCount(int, int)
-
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:
getStartValuein interfaceGanttCategoryDataset- 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 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:
getStartValuein interfaceGanttCategoryDataset- 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 java.lang.Number getEndValue(int row, int column, int subinterval)Returns the end value of a sub-interval for a given item.- Specified by:
getEndValuein interfaceGanttCategoryDataset- 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 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:
getEndValuein interfaceGanttCategoryDataset- 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 java.lang.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- 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 java.lang.Number getPercentComplete(java.lang.Comparable rowKey, java.lang.Comparable columnKey, int subinterval)Returns the percentage complete value of a sub-interval for a given item.- Specified by:
getPercentCompletein interfaceGanttCategoryDataset- 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- Parameters:
event- information about the change.
-
refreshKeys
private void refreshKeys()
Refreshes the keys.
-
equals
public boolean equals(java.lang.Object obj)
Tests this instance for equality with an arbitrary object.- Overrides:
equalsin classAbstractDataset- Parameters:
obj- the object (nullpermitted).- Returns:
- A boolean.
-
canEqual
public boolean canEqual(java.lang.Object other)
Ensures symmetry between super/subclass implementations of equals. For more detail, see http://jqno.nl/equalsverifier/manual/inheritance.- Overrides:
canEqualin classAbstractDataset- Parameters:
other- Object- Returns:
- true ONLY if the parameter is THIS class type
-
hashCode
public int hashCode()
- Overrides:
hashCodein classAbstractDataset
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedExceptionReturns an independent copy of this dataset.- Specified by:
clonein interfacePublicCloneable- Overrides:
clonein classAbstractDataset- Returns:
- A clone of the dataset.
- Throws:
java.lang.CloneNotSupportedException- if there is some problem cloning the dataset.
-
writeObject
private void writeObject(java.io.ObjectOutputStream stream) throws java.io.IOExceptionProvides serialization support.- Parameters:
stream- the output stream.- Throws:
java.io.IOException- if there is an I/O error.
-
readObject
private void readObject(java.io.ObjectInputStream stream) throws java.io.IOException, java.lang.ClassNotFoundExceptionProvides serialization support.- Parameters:
stream- the input stream.- Throws:
java.io.IOException- if there is an I/O error.java.lang.ClassNotFoundException- if there is a classpath problem.
-
-