## org.jfree.data.statistics
Class SimpleHistogramDataset

    java.lang.Object
      org.jfree.data.general.AbstractDataset
          org.jfree.data.general.AbstractSeriesDataset
              org.jfree.data.xy.AbstractXYDataset
                  org.jfree.data.xy.AbstractIntervalXYDataset
                      org.jfree.data.statistics.SimpleHistogramDataset

All Implemented Interfaces:
  java.io.ObjectInputValidation, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, Dataset, SeriesChangeListener, SeriesDataset, IntervalXYDataset, XYDataset, org.jfree.util.PublicCloneable

    public class SimpleHistogramDataset

extends AbstractIntervalXYDataset
implements IntervalXYDataset, java.lang.Cloneable, org.jfree.util.PublicCloneable, java.io.Serializable

A dataset used for creating simple histograms with custom defined bins.

See Also:
  Serialized Form

Constructor Summary
`SimpleHistogramDataset(java.lang.String name)` Creates a new histogram dataset.

Method Summary
`void` `addBin(SimpleHistogramBin bin)` Adds a bin to the dataset.
`void` `addObservation(double value)` Adds an observation to the dataset (by incrementing the item count for the appropriate bin).
`void` `addObservation(double value, boolean notify)` Adds an observation to the dataset (by incrementing the item count for the appropriate bin).
`void` `addObservations(double[] values)` Adds a set of values to the dataset.
`java.lang.Object` `clone()` Returns a clone of the dataset.
`boolean` `equals(java.lang.Object obj)` Compares the dataset for equality with an arbitrary object.
`boolean` `getAdjustForBinSize()` Returns a flag that controls whether or not the bin count is divided by the bin size in the `getXValue(int, int)` method.
`DomainOrder` `getDomainOrder()` Returns the order of the domain (or X) values returned by the dataset.
`java.lang.Number` `getEndX(int series, int item)` Returns the ending X value for the specified series and item.
`double` `getEndXValue(int series, int item)` Returns the end x-value (as a double primitive) for an item within a series.
`java.lang.Number` `getEndY(int series, int item)` Returns the ending Y value for the specified series and item.
`double` `getEndYValue(int series, int item)` Returns the end y-value (as a double primitive) for an item within a series.
`int` `getItemCount(int series)` Returns the number of items in a series.
`int` `getSeriesCount()` Returns the number of series in the dataset (always 1 for this dataset).
`java.lang.String` `getSeriesName(int series)` Returns the name of a series.
`java.lang.Number` `getStartX(int series, int item)` Returns the starting X value for the specified series and item.
`double` `getStartXValue(int series, int item)` Returns the start x-value (as a double primitive) for an item within a series.
`java.lang.Number` `getStartY(int series, int item)` Returns the starting Y value for the specified series and item.
`double` `getStartYValue(int series, int item)` Returns the start y-value (as a double primitive) for an item within a series.
`java.lang.Number` `getX(int series, int item)` Returns the x-value for an item within a 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 an item within a series.
`double` `getYValue(int series, int item)` Returns the y-value (as a double primitive) for an item within a series.
`void` `setAdjustForBinSize(boolean adjust)` Sets the flag that controls whether or not the bin count is divided by the bin size in the `getXValue(int, int)` method.

Methods inherited from class org.jfree.data.general.AbstractSeriesDataset
`seriesChanged`

Methods inherited from class org.jfree.data.general.AbstractDataset
`addChangeListener, fireDatasetChanged, getGroup, notifyListeners, removeChangeListener, setGroup, validateObject`

Methods inherited from class java.lang.Object
`finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface org.jfree.data.general.Dataset
`addChangeListener, getGroup, removeChangeListener, setGroup`

Constructor Detail

### SimpleHistogramDataset

    public SimpleHistogramDataset(java.lang.String name)

  Creates a new histogram dataset.

  Parameters:
    `name` - the series name.

Method Detail

### getAdjustForBinSize

    public boolean getAdjustForBinSize()

  Returns a flag that controls whether or not the bin count is divided by the bin size in the `getXValue(int, int)` method.

  Returns:
    A boolean.

### 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 `getXValue(int, int)` method.

  Parameters:
    `adjust` - the flag.

### getSeriesCount

    public int getSeriesCount()

  Returns the number of series in the dataset (always 1 for this dataset).

  Specified by:
    `getSeriesCount` in interface `SeriesDataset`
  Specified by:
    `getSeriesCount` in class `AbstractSeriesDataset`
  Returns:
    The series count.

### getSeriesName

    public java.lang.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, ignored in this dataset).
  Returns:
    The name of the series.

### getDomainOrder

    public DomainOrder getDomainOrder()

  Returns the order of the domain (or X) values returned by the dataset.

  Specified by:
    `getDomainOrder` in interface `XYDataset`
  Overrides:
    `getDomainOrder` in class `AbstractXYDataset`
  Returns:
    The order (never `null`).

### getItemCount

    public int getItemCount(int series)

  Returns the number of items in a series.

  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).

### 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.

  Parameters:
    `values` - the values.

### getX

    public java.lang.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 java.lang.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.

### getStartX

    public java.lang.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.

### getStartXValue

    public double getStartXValue(int series,
                                 int item)

  Returns the start x-value (as a double primitive) for an item within a series.

  Specified by:
    `getStartXValue` in interface `IntervalXYDataset`
  Overrides:
    `getStartXValue` in class `AbstractIntervalXYDataset`
  Parameters:
    `series` - the series (zero-based index).
    `item` - the item (zero-based index).
  Returns:
    The start x-value.

### getEndX

    public java.lang.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.

### getEndXValue

    public double getEndXValue(int series,
                               int item)

  Returns the end x-value (as a double primitive) for an item within a series.

  Specified by:
    `getEndXValue` in interface `IntervalXYDataset`
  Overrides:
    `getEndXValue` in class `AbstractIntervalXYDataset`
  Parameters:
    `series` - the series index (zero-based).
    `item` - the item index (zero-based).
  Returns:
    The end x-value.

### getStartY

    public java.lang.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.

### getStartYValue

    public double getStartYValue(int series,
                                 int item)

  Returns the start y-value (as a double primitive) for an item within a series.

  Specified by:
    `getStartYValue` in interface `IntervalXYDataset`
  Overrides:
    `getStartYValue` in class `AbstractIntervalXYDataset`
  Parameters:
    `series` - the series index (zero-based).
    `item` - the item index (zero-based).
  Returns:
    The start y-value.

### getEndY

    public java.lang.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.

### getEndYValue

    public double getEndYValue(int series,
                               int item)

  Returns the end y-value (as a double primitive) for an item within a series.

  Specified by:
    `getEndYValue` in interface `IntervalXYDataset`
  Overrides:
    `getEndYValue` in class `AbstractIntervalXYDataset`
  Parameters:
    `series` - the series index (zero-based).
    `item` - the item index (zero-based).
  Returns:
    The end y-value.

### equals

    public boolean equals(java.lang.Object obj)

  Compares the dataset for equality with an arbitrary object.

  Overrides:
    `equals` in class `java.lang.Object`
  Parameters:
    `obj` - the object (`null` permitted).
  Returns:
    A boolean.

### clone

    public java.lang.Object clone()
                           throws java.lang.CloneNotSupportedException

  Returns a clone of the dataset.

  Specified by:
    `clone` in interface `org.jfree.util.PublicCloneable`
  Overrides:
    `clone` in class `AbstractDataset`
  Returns:
    A clone.
  Throws:
    `java.lang.CloneNotSupportedException` - not thrown by this class, but maybe by subclasses (if any).