org.jfree.data.xy

Class XYBarDataset

public class XYBarDataset extends AbstractIntervalXYDataset implements IntervalXYDataset, DatasetChangeListener, PublicCloneable

A dataset wrapper class that converts a standard XYDataset into an IntervalXYDataset suitable for use in creating XY bar charts.
Constructor Summary
XYBarDataset(XYDataset underlying, double barWidth)
Creates a new dataset.
Method Summary
Objectclone()
Returns an independent copy of the dataset.
voiddatasetChanged(DatasetChangeEvent event)
Receives notification of an dataset change event.
booleanequals(Object obj)
Tests this dataset for equality with an arbitrary object.
doublegetBarWidth()
Returns the bar width.
NumbergetEndX(int series, int item)
Returns the ending X value for the specified series and item.
doublegetEndXValue(int series, int item)
Returns the ending x-value (as a double primitive) for an item within a series.
NumbergetEndY(int series, int item)
Returns the ending Y value for the specified series and item.
doublegetEndYValue(int series, int item)
Returns the ending y-value (as a double primitive) for an item within a series.
intgetItemCount(int series)
Returns the number of items in a series.
intgetSeriesCount()
Returns the number of series in the dataset.
ComparablegetSeriesKey(int series)
Returns the key for a series.
NumbergetStartX(int series, int item)
Returns the starting X value for the specified series and item.
doublegetStartXValue(int series, int item)
Returns the starting x-value (as a double primitive) for an item within a series.
NumbergetStartY(int series, int item)
Returns the starting Y value for the specified series and item.
doublegetStartYValue(int series, int item)
Returns the starting y-value (as a double primitive) for an item within a series.
XYDatasetgetUnderlyingDataset()
Returns the underlying dataset that was specified via the constructor.
NumbergetX(int series, int item)
Returns the x-value for an item within a series.
doublegetXValue(int series, int item)
Returns the x-value (as a double primitive) for an item within a series.
NumbergetY(int series, int item)
Returns the y-value for an item within a series.
doublegetYValue(int series, int item)
Returns the y-value (as a double primitive) for an item within a series.
voidsetBarWidth(double barWidth)
Sets the bar width and sends a DatasetChangeEvent to all registered listeners.

Constructor Detail

XYBarDataset

public XYBarDataset(XYDataset underlying, double barWidth)
Creates a new dataset.

Parameters: underlying the underlying dataset (null not permitted). barWidth the width of the bars.

Method Detail

clone

public Object clone()
Returns an independent copy of the dataset. Note that:

Returns: An independent copy of the dataset.

Throws: CloneNotSupportedException if the dataset cannot be cloned for any reason.

datasetChanged

public void datasetChanged(DatasetChangeEvent event)
Receives notification of an dataset change event.

Parameters: event information about the event.

equals

public boolean equals(Object obj)
Tests this dataset for equality with an arbitrary object.

Parameters: obj the object (null permitted).

Returns: A boolean.

getBarWidth

public double getBarWidth()
Returns the bar width.

Returns: The bar width.

Since: 1.0.4

See Also: XYBarDataset

getEndX

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.

getEndXValue

public double getEndXValue(int series, int item)
Returns the ending 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 value.

See Also: XYBarDataset

getEndY

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.

getEndYValue

public double getEndYValue(int series, int item)
Returns the ending 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 value.

See Also: XYBarDataset

getItemCount

public int getItemCount(int series)
Returns the number of items in a series.

Parameters: series the series index (zero-based).

Returns: The item count.

getSeriesCount

public int getSeriesCount()
Returns the number of series in the dataset.

Returns: The series count.

getSeriesKey

public Comparable getSeriesKey(int series)
Returns the key for a series.

Parameters: series the series index (in the range 0 to getSeriesCount() - 1).

Returns: The series key.

getStartX

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.

getStartXValue

public double getStartXValue(int series, int item)
Returns the starting 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 value.

See Also: XYBarDataset

getStartY

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.

getStartYValue

public double getStartYValue(int series, int item)
Returns the starting 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 value.

See Also: XYBarDataset

getUnderlyingDataset

public XYDataset getUnderlyingDataset()
Returns the underlying dataset that was specified via the constructor.

Returns: The underlying dataset (never null).

Since: 1.0.4

getX

public Number getX(int series, int item)
Returns the x-value for an item within a series.

Parameters: series the series index (zero-based). item the item index (zero-based).

Returns: The x-value.

See Also: XYBarDataset

getXValue

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

See Also: XYBarDataset

getY

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

See Also: XYBarDataset

getYValue

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

See Also: XYBarDataset

setBarWidth

public void setBarWidth(double barWidth)
Sets the bar width and sends a DatasetChangeEvent to all registered listeners.

Parameters: barWidth the bar width.

Since: 1.0.4

See Also: getBarWidth