public class

SimpleHistogramDataset

extends AbstractIntervalXYDataset
implements Serializable Cloneable IntervalXYDataset
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

Class Overview

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

See Also

Summary

Public Constructors
SimpleHistogramDataset(Comparable key)
Creates a new histogram dataset.
Public Methods
void addBin(SimpleHistogramBin bin)
Adds a bin to the dataset.
void addObservation(double value, boolean notify)
Adds an observation to the dataset (by incrementing the item count for the appropriate bin).
void addObservation(double value)
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 and sends a DatasetChangeEvent to all registered listeners.
void clearObservations()
Removes all current observation data and sends a DatasetChangeEvent to all registered listeners.
Object clone()
Returns a clone of the dataset.
boolean equals(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.
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.
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).
Comparable getSeriesKey(int series)
Returns the key for a series.
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.
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.
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.
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 removeAllBins()
Removes all bins and sends a DatasetChangeEvent to all registered listeners.
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.
[Expand]
Inherited Methods
From class org.jfree.data.xy.AbstractIntervalXYDataset
From class org.jfree.data.xy.AbstractXYDataset
From class org.jfree.data.general.AbstractSeriesDataset
From class org.jfree.data.general.AbstractDataset
From class java.lang.Object
From interface java.io.ObjectInputValidation
From interface org.jfree.data.general.Dataset
From interface org.jfree.data.general.SeriesChangeListener
From interface org.jfree.data.general.SeriesDataset
From interface org.jfree.data.xy.IntervalXYDataset
From interface org.jfree.data.xy.XYDataset

Public Constructors

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

Public Methods

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

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?

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.

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

public void clearObservations ()

Removes all current observation data and sends a DatasetChangeEvent to all registered listeners.

public Object clone ()

Returns a clone of the dataset.

Returns
  • A clone.
Throws
CloneNotSupportedException not thrown by this class, but maybe by subclasses (if any).

public boolean equals (Object obj)

Compares the dataset for equality with an arbitrary object.

Parameters
obj the object (null permitted).
Returns
  • A boolean.

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.

public DomainOrder getDomainOrder ()

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

Returns
  • The order (never null).

public Number getEndX (int series, int item)

Returns the ending X value for the specified series and item.

Parameters
series the series index (zero-based).
item the item index (zero-based).
Returns
  • The value.

public double getEndXValue (int series, int item)

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

Parameters
series the series index (zero-based).
item the item index (zero-based).
Returns
  • The end x-value.

public Number getEndY (int series, int item)

Returns the ending Y value for the specified series and item.

Parameters
series the series index (zero-based).
item the item index (zero-based).
Returns
  • The value.

public double getEndYValue (int series, int item)

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

Parameters
series the series index (zero-based).
item the item index (zero-based).
Returns
  • The end y-value.

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.

Parameters
series the series index (zero-based, ignored in this dataset).
Returns
  • The item count.

public int getSeriesCount ()

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

Returns
  • The series count.

public Comparable getSeriesKey (int series)

Returns the key for a series. Since this dataset only stores a single series, the series argument is ignored.

Parameters
series the series (zero-based index, ignored in this dataset).
Returns
  • The key for the series.

public Number getStartX (int series, int item)

Returns the starting X value for the specified series and item.

Parameters
series the series index (zero-based).
item the item index (zero-based).
Returns
  • The value.

public double getStartXValue (int series, int item)

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

Parameters
series the series (zero-based index).
item the item (zero-based index).
Returns
  • The start x-value.

public Number getStartY (int series, int item)

Returns the starting Y value for the specified series and item.

Parameters
series the series index (zero-based).
item the item index (zero-based).
Returns
  • The value.

public double getStartYValue (int series, int item)

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

Parameters
series the series index (zero-based).
item the item index (zero-based).
Returns
  • The start y-value.

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.

Parameters
series the series index (zero-based).
item the item index (zero-based).
Returns
  • The x-value (never null).

public double getXValue (int series, int item)

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

Parameters
series the series index (zero-based).
item the item index (zero-based).
Returns
  • The x-value.

public Number getY (int series, int item)

Returns the y-value for an item within a series.

Parameters
series the series index (zero-based).
item the item index (zero-based).
Returns
  • The y-value (possibly null).

public double getYValue (int series, int item)

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

Parameters
series the series index (zero-based).
item the item index (zero-based).
Returns
  • The y-value.

public void removeAllBins ()

Removes all bins and sends a DatasetChangeEvent to all registered listeners.

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.