SimpleHistogramDataset
org.jfree.data.statistics

Class SimpleHistogramDataset

    • Constructor Detail

      • SimpleHistogramDataset

        public SimpleHistogramDataset(Comparable key)
        Creates a new histogram dataset. Note that the adjustForBinSize flag defaults to true.
        Parameters:
        key - the series key (null not permitted).
    • Method Detail

      • setAdjustForBinSize

        public void setAdjustForBinSize(boolean adjust)
        Sets the flag that controls whether or not the bin count is divided by the bin size in the getYValue(int, int) method, and sends a DatasetChangeEvent to all registered listeners.
        Parameters:
        adjust - the flag.
        See Also:
        getAdjustForBinSize()
      • getSeriesKey

        public Comparable getSeriesKey(int series)
        Returns the key for a series. Since this dataset only stores a single series, the series argument is ignored.
        Specified by:
        getSeriesKey in interface SeriesDataset
        Specified by:
        getSeriesKey in class AbstractSeriesDataset
        Parameters:
        series - the series (zero-based index, ignored in this dataset).
        Returns:
        The key for the series.
      • getItemCount

        public int getItemCount(int series)
        Returns the number of items in a series. Since this dataset only stores a single series, the series argument is ignored.
        Specified by:
        getItemCount in interface XYDataset
        Parameters:
        series - the series index (zero-based, ignored in this dataset).
        Returns:
        The item count.
      • addBin

        public void addBin(SimpleHistogramBin bin)
        Adds a bin to the dataset. An exception is thrown if the bin overlaps with any existing bin in the dataset.
        Parameters:
        bin - the bin (null not permitted).
        See Also:
        removeAllBins()
      • addObservation

        public void addObservation(double value)
        Adds an observation to the dataset (by incrementing the item count for the appropriate bin). A runtime exception is thrown if the value does not fit into any bin.
        Parameters:
        value - the value.
      • addObservation

        public void addObservation(double value,                  boolean notify)
        Adds an observation to the dataset (by incrementing the item count for the appropriate bin). A runtime exception is thrown if the value does not fit into any bin.
        Parameters:
        value - the value.
        notify - send DatasetChangeEvent to listeners?
      • addObservations

        public void addObservations(double[] values)
        Adds a set of values to the dataset and sends a DatasetChangeEvent to all registered listeners.
        Parameters:
        values - the values (null not permitted).
        See Also:
        clearObservations()
      • getX

        public Number getX(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:
        getX in interface XYDataset
        Parameters:
        series - the series index (zero-based).
        item - the item index (zero-based).
        Returns:
        The x-value (never null).
      • 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 x-value.
      • getY

        public Number getY(int series,          int item)
        Returns the y-value for an item within a series.
        Specified by:
        getY in interface XYDataset
        Parameters:
        series - the series index (zero-based).
        item - the item index (zero-based).
        Returns:
        The y-value (possibly null).
      • 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 y-value.
        See Also:
        getAdjustForBinSize()
      • getStartX

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

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

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

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

        public boolean equals(Object obj)
        Compares the dataset for equality with an arbitrary object.
        Overrides:
        equals in class Object
        Parameters:
        obj - the object (null permitted).
        Returns:
        A boolean.

SCaVis 2.0 © jWork.ORG