Class XYTaskDataset

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private double seriesWidth
      The series interval width (typically 0.0 < w <= 1.0).
      private boolean transposed
      A flag that controls whether or not the data values are transposed.
      private TaskSeriesCollection underlying
      The underlying tasks.
    • Constructor Summary

      Constructors 
      Constructor Description
      XYTaskDataset​(TaskSeriesCollection tasks)
      Creates a new dataset based on the supplied collection of tasks.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean canEqual​(java.lang.Object other)
      Ensures symmetry between super/subclass implementations of equals.
      java.lang.Object clone()
      Returns a clone of this dataset.
      void datasetChanged​(DatasetChangeEvent event)
      Receives a change event from the underlying dataset and responds by firing a change event for this dataset.
      boolean equals​(java.lang.Object obj)
      Tests this dataset for equality with an arbitrary object.
      java.lang.Number getEndX​(int series, int item)
      Returns the ending date/time for the specified item (task) in the given series, measured in milliseconds since 1-Jan-1970 (as in java.util.Date).
      double getEndXValue​(int series, int item)
      Returns the ending date/time for the specified item (task) in the given series, measured in milliseconds since 1-Jan-1970 (as in java.util.Date).
      java.lang.Number getEndY​(int series, int item)
      Returns the ending value of the y-interval for an item in the given series.
      double getEndYValue​(int series, int item)
      Returns the ending value of the y-interval for an item in the given series.
      int getItemCount​(int series)
      Returns the number of items (tasks) in the specified series.
      private double getItemEndValue​(int series, int item)  
      private double getItemStartValue​(int series, int item)  
      private double getItemValue​(int series, int item)  
      int getSeriesCount()
      Returns the number of series in the dataset.
      private double getSeriesEndValue​(int series)  
      java.lang.Comparable getSeriesKey​(int series)
      Returns the name of a series.
      private double getSeriesStartValue​(int series)  
      private double getSeriesValue​(int series)  
      double getSeriesWidth()
      Returns the width of the interval for each series this dataset.
      java.lang.Number getStartX​(int series, int item)
      Returns the starting date/time for the specified item (task) in the given series, measured in milliseconds since 1-Jan-1970 (as in java.util.Date).
      double getStartXValue​(int series, int item)
      Returns the starting date/time for the specified item (task) in the given series, measured in milliseconds since 1-Jan-1970 (as in java.util.Date).
      java.lang.Number getStartY​(int series, int item)
      Returns the starting value of the y-interval for an item in the given series.
      double getStartYValue​(int series, int item)
      Returns the starting value of the y-interval for an item in the given series.
      TaskSeriesCollection getTasks()
      Returns the underlying task series collection that was supplied to the constructor.
      java.lang.Number getX​(int series, int item)
      Returns the x-value for the specified series.
      double getXValue​(int series, int item)
      Returns the x-value (as a double primitive) for an item within a series.
      java.lang.Number getY​(int series, int item)
      Returns the y-value for the specified series/item.
      double getYValue​(int series, int item)
      Returns the y-value (as a double primitive) for an item within a series.
      int hashCode()  
      boolean isTransposed()
      Returns a flag that indicates whether or not the dataset is transposed.
      void setSeriesWidth​(double w)
      Sets the series interval width and sends a DatasetChangeEvent to all registered listeners.
      void setTransposed​(boolean transposed)
      Sets the flag that controls whether or not the dataset is transposed and sends a DatasetChangeEvent to all registered listeners.
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • seriesWidth

        private double seriesWidth
        The series interval width (typically 0.0 < w <= 1.0).
      • transposed

        private boolean transposed
        A flag that controls whether or not the data values are transposed.
    • Constructor Detail

      • XYTaskDataset

        public XYTaskDataset​(TaskSeriesCollection tasks)
        Creates a new dataset based on the supplied collection of tasks.
        Parameters:
        tasks - the underlying dataset (null not permitted).
    • Method Detail

      • getTasks

        public TaskSeriesCollection getTasks()
        Returns the underlying task series collection that was supplied to the constructor.
        Returns:
        The underlying collection (never null).
      • getSeriesWidth

        public double getSeriesWidth()
        Returns the width of the interval for each series this dataset.
        Returns:
        The width of the series interval.
        See Also:
        setSeriesWidth(double)
      • setSeriesWidth

        public void setSeriesWidth​(double w)
        Sets the series interval width and sends a DatasetChangeEvent to all registered listeners.
        Parameters:
        w - the width.
        See Also:
        getSeriesWidth()
      • isTransposed

        public boolean isTransposed()
        Returns a flag that indicates whether or not the dataset is transposed. The default is false which means the x-values are integers corresponding to the series indices, and the y-values are millisecond values corresponding to the task date/time intervals. If the flag is set to true, the x and y-values are reversed.
        Returns:
        The flag.
        See Also:
        setTransposed(boolean)
      • setTransposed

        public void setTransposed​(boolean transposed)
        Sets the flag that controls whether or not the dataset is transposed and sends a DatasetChangeEvent to all registered listeners.
        Parameters:
        transposed - the new flag value.
        See Also:
        isTransposed()
      • 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.
      • getItemCount

        public int getItemCount​(int series)
        Returns the number of items (tasks) in the specified series.
        Specified by:
        getItemCount in interface XYDataset
        Parameters:
        series - the series index (zero-based).
        Returns:
        The item count.
      • getXValue

        public double getXValue​(int series,
                                int item)
        Returns the x-value (as a double primitive) for an item within a series.
        Specified by:
        getXValue in interface XYDataset
        Overrides:
        getXValue in class AbstractXYDataset
        Parameters:
        series - the series index (zero-based).
        item - the item index (zero-based).
        Returns:
        The value.
      • getStartXValue

        public double getStartXValue​(int series,
                                     int item)
        Returns the starting date/time for the specified item (task) in the given series, measured in milliseconds since 1-Jan-1970 (as in java.util.Date).
        Specified by:
        getStartXValue in interface IntervalXYDataset
        Parameters:
        series - the series index.
        item - the item (or task) index.
        Returns:
        The start date/time.
        See Also:
        IntervalXYDataset.getStartX(int, int)
      • getEndXValue

        public double getEndXValue​(int series,
                                   int item)
        Returns the ending date/time for the specified item (task) in the given series, measured in milliseconds since 1-Jan-1970 (as in java.util.Date).
        Specified by:
        getEndXValue in interface IntervalXYDataset
        Parameters:
        series - the series index.
        item - the item (or task) index.
        Returns:
        The end date/time.
        See Also:
        IntervalXYDataset.getEndX(int, int)
      • getX

        public java.lang.Number getX​(int series,
                                     int item)
        Returns the x-value for the specified series.
        Specified by:
        getX in interface XYDataset
        Parameters:
        series - the series index.
        item - the item index.
        Returns:
        The x-value (in milliseconds).
      • getStartX

        public java.lang.Number getStartX​(int series,
                                          int item)
        Returns the starting date/time for the specified item (task) in the given series, measured in milliseconds since 1-Jan-1970 (as in java.util.Date).
        Specified by:
        getStartX in interface IntervalXYDataset
        Parameters:
        series - the series index.
        item - the item (or task) index.
        Returns:
        The start date/time.
      • getEndX

        public java.lang.Number getEndX​(int series,
                                        int item)
        Returns the ending date/time for the specified item (task) in the given series, measured in milliseconds since 1-Jan-1970 (as in java.util.Date).
        Specified by:
        getEndX in interface IntervalXYDataset
        Parameters:
        series - the series index.
        item - the item (or task) index.
        Returns:
        The end date/time.
      • getYValue

        public double getYValue​(int series,
                                int item)
        Returns the y-value (as a double primitive) for an item within a series.
        Specified by:
        getYValue in interface XYDataset
        Overrides:
        getYValue in class AbstractXYDataset
        Parameters:
        series - the series index (zero-based).
        item - the item index (zero-based).
        Returns:
        The value.
      • getStartYValue

        public double getStartYValue​(int series,
                                     int item)
        Returns the starting value of the y-interval for an item in the given series.
        Specified by:
        getStartYValue in interface IntervalXYDataset
        Parameters:
        series - the series index.
        item - the item (or task) index.
        Returns:
        The y-interval start.
        See Also:
        IntervalXYDataset.getStartY(int, int)
      • getEndYValue

        public double getEndYValue​(int series,
                                   int item)
        Returns the ending value of the y-interval for an item in the given series.
        Specified by:
        getEndYValue in interface IntervalXYDataset
        Parameters:
        series - the series index.
        item - the item (or task) index.
        Returns:
        The y-interval end.
        See Also:
        IntervalXYDataset.getEndY(int, int)
      • getY

        public java.lang.Number getY​(int series,
                                     int item)
        Returns the y-value for the specified series/item. In this implementation, we return the series index as the y-value (this means that every item in the series has a constant integer value).
        Specified by:
        getY in interface XYDataset
        Parameters:
        series - the series index.
        item - the item index.
        Returns:
        The y-value.
      • getStartY

        public java.lang.Number getStartY​(int series,
                                          int item)
        Returns the starting value of the y-interval for an item in the given series.
        Specified by:
        getStartY in interface IntervalXYDataset
        Parameters:
        series - the series index.
        item - the item (or task) index.
        Returns:
        The y-interval start.
      • getEndY

        public java.lang.Number getEndY​(int series,
                                        int item)
        Returns the ending value of the y-interval for an item in the given series.
        Specified by:
        getEndY in interface IntervalXYDataset
        Parameters:
        series - the series index.
        item - the item (or task) index.
        Returns:
        The y-interval end.
      • getSeriesValue

        private double getSeriesValue​(int series)
      • getSeriesStartValue

        private double getSeriesStartValue​(int series)
      • getSeriesEndValue

        private double getSeriesEndValue​(int series)
      • getItemValue

        private double getItemValue​(int series,
                                    int item)
      • getItemStartValue

        private double getItemStartValue​(int series,
                                         int item)
      • getItemEndValue

        private double getItemEndValue​(int series,
                                       int item)
      • datasetChanged

        public void datasetChanged​(DatasetChangeEvent event)
        Receives a change event from the underlying dataset and responds by firing a change event for this dataset.
        Specified by:
        datasetChanged in interface DatasetChangeListener
        Parameters:
        event - the event.
      • equals

        public boolean equals​(java.lang.Object obj)
        Tests this dataset 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 a clone of this dataset.
        Overrides:
        clone in class AbstractDataset
        Returns:
        A clone of this dataset.
        Throws:
        java.lang.CloneNotSupportedException - if there is a problem cloning.