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.xy.DefaultIntervalXYDataset
- All Implemented Interfaces:
ObjectInputValidation,Serializable,Cloneable,EventListener,PublicCloneable,Dataset,SeriesChangeListener,SeriesDataset,IntervalXYDataset,XYDataset
A dataset that defines a range (interval) for both the x-values and the
y-values. This implementation uses six arrays to store the x, start-x,
end-x, y, start-y and end-y values.
An alternative implementation of the
An alternative implementation of the
IntervalXYDataset interface
is provided by the XYIntervalSeriesCollection class.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a newDefaultIntervalXYDatasetinstance, initially containing no data. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSeries(Comparable seriesKey, double[][] data) Adds a series or if a series with the same key already exists replaces the data for that series, then sends aDatasetChangeEventto all registered listeners.clone()Returns a clone of this dataset.booleanTests thisDefaultIntervalXYDatasetinstance for equality with an arbitrary object.getEndX(int series, int item) Returns the ending x-value for an item within a series.doublegetEndXValue(int series, int item) Returns the ending x-value for an item within a series.getEndY(int series, int item) Returns the ending y-value for an item within a series.doublegetEndYValue(int series, int item) Returns the ending y-value for an item within a series.intgetItemCount(int series) Returns the number of items in the specified 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 an item within a series.doublegetStartXValue(int series, int item) Returns the starting x-value for an item within a series.getStartY(int series, int item) Returns the starting y-value for an item within a series.doublegetStartYValue(int series, int item) Returns the starting y-value for an item within a series.getX(int series, int item) Returns the x-value for an item within a series.doublegetXValue(int series, int item) Returns the x-value 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 for an item within a series.inthashCode()Returns a hash code for this instance.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, fireDatasetChanged, getGroup, getNotify, 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
-
DefaultIntervalXYDataset
public DefaultIntervalXYDataset()Creates a newDefaultIntervalXYDatasetinstance, initially containing no data.
-
-
Method Details
-
getSeriesCount
public int 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 key for the series.
- Throws:
IllegalArgumentException- ifseriesis not in the specified range.
-
getItemCount
public int getItemCount(int series) Returns the number of items in the specified series.- Specified by:
getItemCountin interfaceXYDataset- Parameters:
series- the series index (in the range0togetSeriesCount() - 1).- Returns:
- The item count.
- Throws:
IllegalArgumentException- ifseriesis not in the specified range.
-
getXValue
public double getXValue(int series, int item) Returns the x-value for an item within a series.- Specified by:
getXValuein interfaceXYDataset- Overrides:
getXValuein classAbstractXYDataset- Parameters:
series- the series index (in the range0togetSeriesCount() - 1).item- the item index (in the range0togetItemCount(series)).- Returns:
- The x-value.
- Throws:
ArrayIndexOutOfBoundsException- ifseriesis not within the specified range.ArrayIndexOutOfBoundsException- ifitemis not within the specified range.- See Also:
-
getYValue
public double getYValue(int series, int item) Returns the y-value for an item within a series.- Specified by:
getYValuein interfaceXYDataset- Overrides:
getYValuein classAbstractXYDataset- Parameters:
series- the series index (in the range0togetSeriesCount() - 1).item- the item index (in the range0togetItemCount(series)).- Returns:
- The y-value.
- Throws:
ArrayIndexOutOfBoundsException- ifseriesis not within the specified range.ArrayIndexOutOfBoundsException- ifitemis not within the specified range.- See Also:
-
getStartXValue
public double getStartXValue(int series, int item) Returns the starting x-value for an item within a series.- Specified by:
getStartXValuein interfaceIntervalXYDataset- Overrides:
getStartXValuein classAbstractIntervalXYDataset- Parameters:
series- the series index (in the range0togetSeriesCount() - 1).item- the item index (in the range0togetItemCount(series)).- Returns:
- The starting x-value.
- Throws:
ArrayIndexOutOfBoundsException- ifseriesis not within the specified range.ArrayIndexOutOfBoundsException- ifitemis not within the specified range.- See Also:
-
getEndXValue
public double getEndXValue(int series, int item) Returns the ending x-value for an item within a series.- Specified by:
getEndXValuein interfaceIntervalXYDataset- Overrides:
getEndXValuein classAbstractIntervalXYDataset- Parameters:
series- the series index (in the range0togetSeriesCount() - 1).item- the item index (in the range0togetItemCount(series)).- Returns:
- The ending x-value.
- Throws:
ArrayIndexOutOfBoundsException- ifseriesis not within the specified range.ArrayIndexOutOfBoundsException- ifitemis not within the specified range.- See Also:
-
getStartYValue
public double getStartYValue(int series, int item) Returns the starting y-value for an item within a series.- Specified by:
getStartYValuein interfaceIntervalXYDataset- Overrides:
getStartYValuein classAbstractIntervalXYDataset- Parameters:
series- the series index (in the range0togetSeriesCount() - 1).item- the item index (in the range0togetItemCount(series)).- Returns:
- The starting y-value.
- Throws:
ArrayIndexOutOfBoundsException- ifseriesis not within the specified range.ArrayIndexOutOfBoundsException- ifitemis not within the specified range.- See Also:
-
getEndYValue
public double getEndYValue(int series, int item) Returns the ending y-value for an item within a series.- Specified by:
getEndYValuein interfaceIntervalXYDataset- Overrides:
getEndYValuein classAbstractIntervalXYDataset- Parameters:
series- the series index (in the range0togetSeriesCount() - 1).item- the item index (in the range0togetItemCount(series)).- Returns:
- The ending y-value.
- Throws:
ArrayIndexOutOfBoundsException- ifseriesis not within the specified range.ArrayIndexOutOfBoundsException- ifitemis not within the specified range.- See Also:
-
getEndX
Returns the ending x-value for an item within a series.- Specified by:
getEndXin interfaceIntervalXYDataset- Parameters:
series- the series index (in the range0togetSeriesCount() - 1).item- the item index (in the range0togetItemCount(series)).- Returns:
- The ending x-value.
- Throws:
ArrayIndexOutOfBoundsException- ifseriesis not within the specified range.ArrayIndexOutOfBoundsException- ifitemis not within the specified range.- See Also:
-
getEndY
Returns the ending y-value for an item within a series.- Specified by:
getEndYin interfaceIntervalXYDataset- Parameters:
series- the series index (in the range0togetSeriesCount() - 1).item- the item index (in the range0togetItemCount(series)).- Returns:
- The ending y-value.
- Throws:
ArrayIndexOutOfBoundsException- ifseriesis not within the specified range.ArrayIndexOutOfBoundsException- ifitemis not within the specified range.- See Also:
-
getStartX
Returns the starting x-value for an item within a series.- Specified by:
getStartXin interfaceIntervalXYDataset- Parameters:
series- the series index (in the range0togetSeriesCount() - 1).item- the item index (in the range0togetItemCount(series)).- Returns:
- The starting x-value.
- Throws:
ArrayIndexOutOfBoundsException- ifseriesis not within the specified range.ArrayIndexOutOfBoundsException- ifitemis not within the specified range.- See Also:
-
getStartY
Returns the starting y-value for an item within a series.- Specified by:
getStartYin interfaceIntervalXYDataset- Parameters:
series- the series index (in the range0togetSeriesCount() - 1).item- the item index (in the range0togetItemCount(series)).- Returns:
- The starting y-value.
- Throws:
ArrayIndexOutOfBoundsException- ifseriesis not within the specified range.ArrayIndexOutOfBoundsException- ifitemis not within the specified range.- See Also:
-
getX
Returns the x-value for an item within a series.- Specified by:
getXin interfaceXYDataset- Parameters:
series- the series index (in the range0togetSeriesCount() - 1).item- the item index (in the range0togetItemCount(series)).- Returns:
- The x-value.
- Throws:
ArrayIndexOutOfBoundsException- ifseriesis not within the specified range.ArrayIndexOutOfBoundsException- ifitemis not within the specified range.- See Also:
-
getY
Returns the y-value for an item within a series.- Specified by:
getYin interfaceXYDataset- Parameters:
series- the series index (in the range0togetSeriesCount() - 1).item- the item index (in the range0togetItemCount(series)).- Returns:
- The y-value.
- Throws:
ArrayIndexOutOfBoundsException- ifseriesis not within the specified range.ArrayIndexOutOfBoundsException- ifitemis not within the specified range.- See Also:
-
addSeries
Adds a series or if a series with the same key already exists replaces the data for that series, then sends aDatasetChangeEventto all registered listeners.- Parameters:
seriesKey- the series key (nullnot permitted).data- the data (must be an array with length 6, containing six arrays of equal length, the first three containing the x-values (x, xLow and xHigh) and the last three containing the y-values (y, yLow and yHigh)).
-
equals
Tests thisDefaultIntervalXYDatasetinstance for equality with an arbitrary object. This method returnstrueif and only if:objis notnull;objis an instance ofDefaultIntervalXYDataset;- both datasets have the same number of series, each containing exactly the same values.
-
hashCode
public int hashCode()Returns a hash code for this instance. -
clone
Returns a clone of this dataset.- Specified by:
clonein interfacePublicCloneable- Overrides:
clonein classAbstractDataset- Returns:
- A clone.
- Throws:
CloneNotSupportedException- if the dataset contains a series with a key that cannot be cloned.
-