Package org.jfree.data.xy
Class XYBarDataset
- All Implemented Interfaces:
ObjectInputValidation,Serializable,Cloneable,EventListener,PublicCloneable,Dataset,DatasetChangeListener,SeriesChangeListener,SeriesDataset,IntervalXYDataset,XYDataset
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.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()Returns an independent copy of the dataset.voiddatasetChanged(DatasetChangeEvent event) Receives notification of an dataset change event.booleanTests this dataset for equality with an arbitrary object.doubleReturns the bar width.getEndX(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.getEndY(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.intReturns the number of series in the dataset.getSeriesKey(int series) Returns the key for a series.getStartX(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.getStartY(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.Returns the underlying dataset that was specified via the constructor.getX(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.getY(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 aDatasetChangeEventto all registered listeners.Methods inherited from class org.jfree.data.xy.AbstractXYDataset
getDomainOrderMethods inherited from class org.jfree.data.general.AbstractSeriesDataset
indexOf, seriesChangedMethods inherited from class org.jfree.data.general.AbstractDataset
addChangeListener, canEqual, fireDatasetChanged, getGroup, getNotify, hashCode, hasListener, notifyListeners, removeChangeListener, setGroup, setNotify, validateObjectMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jfree.data.general.Dataset
addChangeListener, getGroup, removeChangeListener, setGroupMethods inherited from interface org.jfree.data.general.SeriesDataset
indexOfMethods inherited from interface org.jfree.data.xy.XYDataset
getDomainOrder
-
Constructor Details
-
XYBarDataset
Creates a new dataset.- Parameters:
underlying- the underlying dataset (nullnot permitted).barWidth- the width of the bars.
-
-
Method Details
-
getUnderlyingDataset
Returns the underlying dataset that was specified via the constructor.- Returns:
- The underlying dataset (never
null).
-
getBarWidth
Returns the bar width.- Returns:
- The bar width.
- See Also:
-
setBarWidth
Sets the bar width and sends aDatasetChangeEventto all registered listeners.- Parameters:
barWidth- the bar width.- See Also:
-
getSeriesCount
Returns the number of series in the dataset.- Specified by:
getSeriesCountin interfaceSeriesDataset- Specified by:
getSeriesCountin classAbstractSeriesDataset- Returns:
- The series count.
-
getSeriesKey
Returns the key for a series.- Specified by:
getSeriesKeyin interfaceSeriesDataset- Specified by:
getSeriesKeyin classAbstractSeriesDataset- Parameters:
series- the series index (in the range0togetSeriesCount() - 1).- Returns:
- The series key.
-
getItemCount
Returns the number of items in a series.- Specified by:
getItemCountin interfaceXYDataset- Parameters:
series- the series index (zero-based).- Returns:
- The item count.
-
getX
Returns the x-value for an item within a series. -
getXValue
Returns the x-value (as a double primitive) for an item within a series.- Specified by:
getXValuein interfaceXYDataset- Overrides:
getXValuein classAbstractXYDataset- Parameters:
series- the series index (zero-based).item- the item index (zero-based).- Returns:
- The value.
- See Also:
-
getY
Returns the y-value for an item within a series. -
getYValue
Returns the y-value (as a double primitive) for an item within a series.- Specified by:
getYValuein interfaceXYDataset- Overrides:
getYValuein classAbstractXYDataset- Parameters:
series- the series index (zero-based).item- the item index (zero-based).- Returns:
- The value.
- See Also:
-
getStartX
Returns the starting X value for the specified series and item.- Specified by:
getStartXin interfaceIntervalXYDataset- Parameters:
series- the series index (zero-based).item- the item index (zero-based).- Returns:
- The value.
-
getStartXValue
Returns the starting x-value (as a double primitive) for an item within a series.- Specified by:
getStartXValuein interfaceIntervalXYDataset- Overrides:
getStartXValuein classAbstractIntervalXYDataset- Parameters:
series- the series index (zero-based).item- the item index (zero-based).- Returns:
- The value.
- See Also:
-
getEndX
Returns the ending X value for the specified series and item.- Specified by:
getEndXin interfaceIntervalXYDataset- Parameters:
series- the series index (zero-based).item- the item index (zero-based).- Returns:
- The value.
-
getEndXValue
Returns the ending x-value (as a double primitive) for an item within a series.- Specified by:
getEndXValuein interfaceIntervalXYDataset- Overrides:
getEndXValuein classAbstractIntervalXYDataset- Parameters:
series- the series index (zero-based).item- the item index (zero-based).- Returns:
- The value.
- See Also:
-
getStartY
Returns the starting Y value for the specified series and item.- Specified by:
getStartYin interfaceIntervalXYDataset- Parameters:
series- the series index (zero-based).item- the item index (zero-based).- Returns:
- The value.
-
getStartYValue
Returns the starting y-value (as a double primitive) for an item within a series.- Specified by:
getStartYValuein interfaceIntervalXYDataset- Overrides:
getStartYValuein classAbstractIntervalXYDataset- Parameters:
series- the series index (zero-based).item- the item index (zero-based).- Returns:
- The value.
- See Also:
-
getEndY
Returns the ending Y value for the specified series and item.- Specified by:
getEndYin interfaceIntervalXYDataset- Parameters:
series- the series index (zero-based).item- the item index (zero-based).- Returns:
- The value.
-
getEndYValue
Returns the ending y-value (as a double primitive) for an item within a series.- Specified by:
getEndYValuein interfaceIntervalXYDataset- Overrides:
getEndYValuein classAbstractIntervalXYDataset- Parameters:
series- the series index (zero-based).item- the item index (zero-based).- Returns:
- The value.
- See Also:
-
datasetChanged
Receives notification of an dataset change event.- Specified by:
datasetChangedin interfaceDatasetChangeListener- Parameters:
event- information about the event.
-
equals
Tests this dataset for equality with an arbitrary object.- Overrides:
equalsin classAbstractDataset- Parameters:
obj- the object (nullpermitted).- Returns:
- A boolean.
-
clone
Returns an independent copy of the dataset. Note that:- the underlying dataset is only cloned if it implements the
PublicCloneableinterface; - the listeners registered with this dataset are not carried over to the cloned dataset.
- Specified by:
clonein interfacePublicCloneable- Overrides:
clonein classAbstractDataset- Returns:
- An independent copy of the dataset.
- Throws:
CloneNotSupportedException- if the dataset cannot be cloned for any reason.
- the underlying dataset is only cloned if it implements the
-