Class XYBarDataset

All Implemented Interfaces:
ObjectInputValidation, Serializable, Cloneable, EventListener, Dataset, DatasetChangeListener, IntervalXYDataset, SeriesChangeListener, SeriesDataset, XYDataset

public class XYBarDataset
extends AbstractIntervalXYDataset
implements IntervalXYDataset, DatasetChangeListener
A dataset wrapper class that converts a standard XYDataset into an IntervalXYDataset suitable for use in creating XY bar charts.
See Also:
Serialized Form
  • Constructor Details

    • XYBarDataset

      public XYBarDataset​(XYDataset underlying, double barWidth)
      Creates a new dataset.
      Parameters:
      underlying - the underlying dataset.
      barWidth - the width of the bars.
  • Method Details

    • getSeriesCount

      public int getSeriesCount()
      Returns the number of series in the dataset.
      Specified by:
      getSeriesCount in interface SeriesDataset
      Specified by:
      getSeriesCount in class AbstractSeriesDataset
      Returns:
      The series count.
    • getSeriesName

      public 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).
      Returns:
      The series name.
    • getItemCount

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

      public Number getXValue​(int series, int item)
      Returns the x-value for an item within a series. The x-values may or may not be returned in ascending order, that is up to the class implementing the interface.
      Specified by:
      getXValue in interface XYDataset
      Parameters:
      series - the series (zero-based index).
      item - the item (zero-based index).
      Returns:
      The x-value.
    • getYValue

      public Number getYValue​(int series, int item)
      Returns the y-value for an item within a series.
      Specified by:
      getYValue in interface XYDataset
      Parameters:
      series - the series (zero-based index).
      item - the item (zero-based index).
      Returns:
      The y-value (possibly null).
    • getStartXValue

      public Number getStartXValue​(int series, int item)
      Returns the starting X value for the specified series and item.
      Specified by:
      getStartXValue in interface IntervalXYDataset
      Parameters:
      series - the series (zero-based index).
      item - the item within a series (zero-based index).
      Returns:
      The starting X value for the specified series and item.
    • getEndXValue

      public Number getEndXValue​(int series, int item)
      Returns the ending X value for the specified series and item.
      Specified by:
      getEndXValue in interface IntervalXYDataset
      Parameters:
      series - the series (zero-based index).
      item - the item within a series (zero-based index).
      Returns:
      The ending X value for the specified series and item.
    • getStartYValue

      public Number getStartYValue​(int series, int item)
      Returns the starting Y value for the specified series and item.
      Specified by:
      getStartYValue in interface IntervalXYDataset
      Parameters:
      series - the series (zero-based index).
      item - the item within a series (zero-based index).
      Returns:
      The starting Y value for the specified series and item.
    • getEndYValue

      public Number getEndYValue​(int series, int item)
      Returns the ending Y value for the specified series and item.
      Specified by:
      getEndYValue in interface IntervalXYDataset
      Parameters:
      series - the series (zero-based index).
      item - the item within a series (zero-based index).
      Returns:
      The ending Y value for the specified series and item.
    • datasetChanged

      public void datasetChanged​(DatasetChangeEvent event)
      Receives notification of an dataset change event.
      Specified by:
      datasetChanged in interface DatasetChangeListener
      Parameters:
      event - information about the event.