jyplot
Class BarXYDataset
- java.lang.Object
-
- All Implemented Interfaces:
- java.io.ObjectInputValidation, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, DomainInfo, Dataset, DatasetChangeListener, SeriesChangeListener, SeriesDataset, RangeInfo, IntervalXYDataset, XYDataset
public class BarXYDataset extends AbstractIntervalXYDataset implements IntervalXYDataset, DomainInfo, RangeInfo, DatasetChangeListener
A quick and dirty sample dataset.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description BarXYDataset()Creates a new dataset.BarXYDataset(double[] x, double[] y, double[] width, double[] height)BarXYDataset(double[] x, double[] y, double[] width, double[] height, java.lang.Comparable seriesKey)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddSeries(double[] x, double[] y, double[] width, double[] height)voidaddSeries(double[] x, double[] y, double[] width, double[] height, java.lang.Comparable seriesKey)voidaddSeries(double x, double y, double width, double height)voiddatasetChanged(DatasetChangeEvent event)Receives notification of an dataset change event.RangegetDomainBounds(boolean includeInterval)Returns the range of the values in this dataset's domain.doublegetDomainLowerBound(boolean includeInterval)Returns the minimum x-value in the dataset.doublegetDomainUpperBound(boolean includeInterval)Returns the maximum x-value in the dataset.java.lang.NumbergetEndX(int series, int item)Returns the ending X value for the specified series and item.doublegetEndXValue(int series, int item)Returns the end x-value (as a double primitive) for an item within a series.java.lang.NumbergetEndY(int series, int item)Returns the ending Y value for the specified series and item.doublegetEndYValue(int series, int item)Returns the end y-value (as a double primitive) for an item within a series.intgetItemCount(int series)Returns the number of items in a series.RangegetRangeBounds(boolean includeInterval)Returns the range of the values in this dataset's range.doublegetRangeLowerBound(boolean includeInterval)Returns the minimum y-value in the dataset.doublegetRangeUpperBound(boolean includeInterval)Returns the maximum y-value in the dataset.intgetSeriesCount()Returns the number of series in the dataset.java.lang.ComparablegetSeriesKey(int series)Returns the key for a series.java.lang.NumbergetStartX(int series, int item)Returns the starting X value for the specified series and item.doublegetStartXValue(int series, int item)Returns the start x-value (as a double primitive) for an item within a series.java.lang.NumbergetStartY(int series, int item)Returns the starting Y value for the specified series and item.doublegetStartYValue(int series, int item)Returns the start y-value (as a double primitive) for an item within a series.java.lang.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.java.lang.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.intindexOf(java.lang.Comparable arg0)Returns the index of the named series, or -1.voidremoveSeries(int index)voidsetSeriesKey(int series, java.lang.Comparable c)This is a test Sets the key for a series.-
Methods inherited from class org.jfree.data.xy.AbstractXYDataset
getDomainOrder
-
Methods inherited from class org.jfree.data.general.AbstractSeriesDataset
seriesChanged
-
Methods inherited from class org.jfree.data.general.AbstractDataset
addChangeListener, clone, getGroup, getNotify, hasListener, removeChangeListener, setGroup, setNotify, validateObject
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jfree.data.xy.XYDataset
getDomainOrder
-
Methods inherited from interface org.jfree.data.general.Dataset
addChangeListener, getGroup, removeChangeListener, setGroup
-
-
-
-
Constructor Detail
-
BarXYDataset
public BarXYDataset()
Creates a new dataset.
-
BarXYDataset
public BarXYDataset(double[] x, double[] y, double[] width, double[] height)
-
BarXYDataset
public BarXYDataset(double[] x, double[] y, double[] width, double[] height, java.lang.Comparable seriesKey)
-
-
Method Detail
-
getRangeBounds
public Range getRangeBounds(boolean includeInterval)
Description copied from interface:RangeInfoReturns the range of the values in this dataset's range.- Specified by:
getRangeBoundsin interfaceRangeInfo- Parameters:
includeInterval- a flag that determines whether or not the y-interval is taken into account.- Returns:
- The range (or
nullif the dataset contains no values).
-
getRangeLowerBound
public double getRangeLowerBound(boolean includeInterval)
Description copied from interface:RangeInfoReturns the minimum y-value in the dataset.- Specified by:
getRangeLowerBoundin interfaceRangeInfo- Parameters:
includeInterval- a flag that determines whether or not the y-interval is taken into account.- Returns:
- The minimum value.
-
getRangeUpperBound
public double getRangeUpperBound(boolean includeInterval)
Description copied from interface:RangeInfoReturns the maximum y-value in the dataset.- Specified by:
getRangeUpperBoundin interfaceRangeInfo- Parameters:
includeInterval- a flag that determines whether or not the y-interval is taken into account.- Returns:
- The maximum value.
-
getDomainBounds
public Range getDomainBounds(boolean includeInterval)
Description copied from interface:DomainInfoReturns the range of the values in this dataset's domain.- Specified by:
getDomainBoundsin interfaceDomainInfo- Parameters:
includeInterval- a flag that determines whether or not the x-interval is taken into account.- Returns:
- The range (or
nullif the dataset contains no values).
-
getDomainLowerBound
public double getDomainLowerBound(boolean includeInterval)
Description copied from interface:DomainInfoReturns the minimum x-value in the dataset.- Specified by:
getDomainLowerBoundin interfaceDomainInfo- Parameters:
includeInterval- a flag that determines whether or not the x-interval is taken into account.- Returns:
- The minimum value or
Double.NaNif there are no values.
-
getDomainUpperBound
public double getDomainUpperBound(boolean includeInterval)
Description copied from interface:DomainInfoReturns the maximum x-value in the dataset.- Specified by:
getDomainUpperBoundin interfaceDomainInfo- Parameters:
includeInterval- a flag that determines whether or not the x-interval is taken into account.- Returns:
- The maximum value or
Double.NaNif there are no values.
-
addSeries
public void addSeries(double x, double y, double width, double height)
-
addSeries
public void addSeries(double[] x, double[] y, double[] width, double[] height)
-
addSeries
public void addSeries(double[] x, double[] y, double[] width, double[] height, java.lang.Comparable seriesKey)
-
getSeriesCount
public int getSeriesCount()
Returns the number of series in the dataset.- Specified by:
getSeriesCountin interfaceSeriesDataset- Specified by:
getSeriesCountin classAbstractSeriesDataset- Returns:
- the number of series in the dataset.
-
getSeriesKey
public java.lang.Comparable getSeriesKey(int series)
Returns the key for a series.- Specified by:
getSeriesKeyin interfaceSeriesDataset- Specified by:
getSeriesKeyin classAbstractSeriesDataset- Parameters:
series- the series (zero-based index).- Returns:
- The series key.
-
setSeriesKey
public void setSeriesKey(int series, java.lang.Comparable c)This is a test Sets the key for a series.- Parameters:
series- the series (zero-based index).
-
getItemCount
public int getItemCount(int series)
Returns the number of items in a series.- Specified by:
getItemCountin interfaceXYDataset- Parameters:
series- the series (zero-based index).- Returns:
- the number of items within a series.
-
getX
public java.lang.Number getX(int series, int item)Returns the x-value for an item within a series.The implementation is responsible for ensuring that the x-values are presented in ascending order.
-
getY
public java.lang.Number getY(int series, int item)Returns the y-value for an item within a series.
-
getStartX
public java.lang.Number getStartX(int series, int item)Returns the starting X value for the specified series and item.- Specified by:
getStartXin interfaceIntervalXYDataset- Parameters:
series- the series (zero-based index).item- the item within a series (zero-based index).- Returns:
- The value.
-
getEndX
public java.lang.Number getEndX(int series, int item)Returns the ending X value for the specified series and item.- Specified by:
getEndXin interfaceIntervalXYDataset- Parameters:
series- the series (zero-based index).item- the item within a series (zero-based index).- 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:
getStartYin interfaceIntervalXYDataset- Parameters:
series- the series (zero-based index).item- the item within a series (zero-based index).- Returns:
- The value.
-
getEndY
public java.lang.Number getEndY(int series, int item)Returns the ending Y value for the specified series and item.- Specified by:
getEndYin interfaceIntervalXYDataset- Parameters:
series- the series (zero-based index).item- the item within a series (zero-based index).- Returns:
- The value.
-
getEndXValue
public double getEndXValue(int series, int item)Description copied from class:AbstractIntervalXYDatasetReturns the end 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:
IntervalXYDataset.getEndX(int, int)
-
getEndYValue
public double getEndYValue(int series, int item)Description copied from class:AbstractIntervalXYDatasetReturns the end y-value (as a double primitive) for an item within a series.- Specified by:
getEndYValuein interfaceIntervalXYDataset- Overrides:
getEndYValuein classAbstractIntervalXYDataset- Parameters:
series- the series (zero-based index).item- the item (zero-based index).- Returns:
- The value.
- See Also:
IntervalXYDataset.getEndY(int, int)
-
getStartXValue
public double getStartXValue(int series, int item)Description copied from class:AbstractIntervalXYDatasetReturns the start 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:
IntervalXYDataset.getStartX(int, int)
-
getStartYValue
public double getStartYValue(int series, int item)Description copied from class:AbstractIntervalXYDatasetReturns the start 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:
IntervalXYDataset.getStartY(int, int)
-
getXValue
public double getXValue(int series, int item)Description copied from class:AbstractXYDatasetReturns 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.
-
getYValue
public double getYValue(int series, int item)Description copied from class:AbstractXYDatasetReturns 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.
-
indexOf
public int indexOf(java.lang.Comparable arg0)
Description copied from class:AbstractSeriesDatasetReturns the index of the named series, or -1.- Specified by:
indexOfin interfaceSeriesDataset- Overrides:
indexOfin classAbstractSeriesDataset- Parameters:
arg0- the series key (nullpermitted).- Returns:
- The index.
-
datasetChanged
public void datasetChanged(DatasetChangeEvent event)
Receives notification of an dataset change event.- Specified by:
datasetChangedin interfaceDatasetChangeListener- Parameters:
event- information about the event.
-
removeSeries
public void removeSeries(int index)
-
-
DMelt 3.0 © DataMelt by jWork.ORG