Class TaskSeriesCollection

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.List data
      Storage for the series.
      private java.util.List keys
      Storage for aggregate task keys (the task description is used as the key).
      private static long serialVersionUID
      For serialization.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(TaskSeries series)
      Adds a series to the dataset and sends a DatasetChangeEvent to all registered listeners.
      boolean canEqual​(java.lang.Object other)
      Ensures symmetry between super/subclass implementations of equals.
      java.lang.Object clone()
      Returns an independent copy of this dataset.
      boolean equals​(java.lang.Object obj)
      Tests this instance for equality with an arbitrary object.
      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 index)
      Returns a column key.
      java.util.List getColumnKeys()
      Returns a list of the column keys in the dataset.
      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.
      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 getPercentComplete​(int row, int column)
      Returns the percent complete for a given item.
      java.lang.Number getPercentComplete​(int row, int column, int subinterval)
      Returns the percentage complete value of a sub-interval for a given item.
      java.lang.Number getPercentComplete​(java.lang.Comparable rowKey, java.lang.Comparable columnKey)
      Returns the percent complete for a given item.
      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.
      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.
      TaskSeries getSeries​(int series)
      Returns a series from the collection.
      TaskSeries getSeries​(java.lang.Comparable key)
      Returns a series from the collection.
      int getSeriesCount()
      Returns the number of series in the collection.
      java.lang.Comparable getSeriesKey​(int series)
      Returns the name of a series.
      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.
      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.
      int getSubIntervalCount​(int row, int column)
      Returns the number of sub-intervals for a given item.
      int getSubIntervalCount​(java.lang.Comparable rowKey, java.lang.Comparable columnKey)
      Returns the number of sub-intervals for a given item.
      java.lang.Number getValue​(int row, int column)
      Returns the value for a task.
      java.lang.Number getValue​(java.lang.Comparable rowKey, java.lang.Comparable columnKey)
      Returns the value for an item.
      int hashCode()  
      private void readObject​(java.io.ObjectInputStream stream)
      Provides serialization support.
      private void refreshKeys()
      Refreshes the keys.
      void remove​(int series)
      Removes a series from the collection and sends a DatasetChangeEvent to all registered listeners.
      void remove​(TaskSeries series)
      Removes a series from the collection and sends a DatasetChangeEvent to all registered listeners.
      void removeAll()
      Removes all the series from the collection and sends a DatasetChangeEvent to all registered listeners.
      void seriesChanged​(SeriesChangeEvent event)
      Called when a series belonging to the dataset changes.
      private void writeObject​(java.io.ObjectOutputStream stream)
      Provides serialization support.
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • 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.
    • Constructor Detail

      • TaskSeriesCollection

        public TaskSeriesCollection()
        Default constructor.
    • Method Detail

      • getSeries

        public TaskSeries getSeries​(java.lang.Comparable key)
        Returns a series from the collection.
        Parameters:
        key - the series key (null not 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.
      • getSeriesKey

        public java.lang.Comparable getSeriesKey​(int series)
        Returns the name of a series.
        Specified by:
        getSeriesKey in interface SeriesDataset
        Specified by:
        getSeriesKey in class AbstractSeriesDataset
        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:
        getRowCount in interface Values2D
        Returns:
        The series 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.
      • getColumnCount

        public int getColumnCount()
        Returns the number of column in the dataset.
        Specified by:
        getColumnCount in interface Values2D
        Returns:
        The column count.
      • 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 index)
        Returns a column key.
        Specified by:
        getColumnKey in interface KeyedValues2D
        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:
        getColumnIndex in interface KeyedValues2D
        Parameters:
        columnKey - the column key (null not permitted).
        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 and sends a DatasetChangeEvent to all registered listeners.
        Parameters:
        series - the series (null not permitted).
      • remove

        public void remove​(TaskSeries series)
        Removes a series from the collection and sends a DatasetChangeEvent to all registered listeners.
        Parameters:
        series - the series.
      • remove

        public void remove​(int series)
        Removes a series from the collection and sends a DatasetChangeEvent to all registered listeners.
        Parameters:
        series - the series (zero based index).
      • removeAll

        public void removeAll()
        Removes all the series from the collection and sends a DatasetChangeEvent to 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:
        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​(int row,
                                              int column,
                                              int subinterval)
        Returns the start value of a sub-interval for a given item.
        Specified by:
        getStartValue in interface GanttCategoryDataset
        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:
        getStartValue in interface GanttCategoryDataset
        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:
        getEndValue in interface GanttCategoryDataset
        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)
      • 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:
        getPercentComplete in interface GanttCategoryDataset
        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)
      • 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:
        equals in class AbstractDataset
        Parameters:
        obj - the object (null permitted).
        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:
        canEqual in class AbstractDataset
        Parameters:
        other - Object
        Returns:
        true ONLY if the parameter is THIS class type
      • clone

        public java.lang.Object clone()
                               throws java.lang.CloneNotSupportedException
        Returns an independent copy of this dataset.
        Specified by:
        clone in interface PublicCloneable
        Overrides:
        clone in class AbstractDataset
        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.IOException
        Provides 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.ClassNotFoundException
        Provides 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.