Package org.jfree.data.xy
Class DefaultIntervalXYDataset
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
ConstructorDescriptionCreates a newDefaultIntervalXYDataset
instance, initially containing no data. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addSeries
(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 aDatasetChangeEvent
to all registered listeners.clone()
Returns a clone of this dataset.boolean
Tests thisDefaultIntervalXYDataset
instance for equality with an arbitrary object.getEndX
(int series, int item) Returns the ending x-value for an item within a series.double
getEndXValue
(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.double
getEndYValue
(int series, int item) Returns the ending y-value for an item within a series.int
getItemCount
(int series) Returns the number of items in the specified series.int
Returns 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.double
getStartXValue
(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.double
getStartYValue
(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.double
getXValue
(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.double
getYValue
(int series, int item) Returns the y-value for an item within a series.int
hashCode()
Returns a hash code for this instance.Methods inherited from class org.jfree.data.xy.AbstractXYDataset
getDomainOrder
Methods inherited from class org.jfree.data.general.AbstractSeriesDataset
indexOf, seriesChanged
Methods inherited from class org.jfree.data.general.AbstractDataset
addChangeListener, canEqual, fireDatasetChanged, getGroup, getNotify, hasListener, notifyListeners, removeChangeListener, setGroup, setNotify, validateObject
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.jfree.data.general.Dataset
addChangeListener, getGroup, removeChangeListener, setGroup
Methods inherited from interface org.jfree.data.general.SeriesDataset
indexOf
Methods inherited from interface org.jfree.data.xy.XYDataset
getDomainOrder
-
Constructor Details
-
DefaultIntervalXYDataset
public DefaultIntervalXYDataset()Creates a newDefaultIntervalXYDataset
instance, initially containing no data.
-
-
Method Details
-
getSeriesCount
Returns the number of series in the dataset.- Specified by:
getSeriesCount
in interfaceSeriesDataset
- Specified by:
getSeriesCount
in classAbstractSeriesDataset
- Returns:
- The series count.
-
getSeriesKey
Returns the key for a series.- Specified by:
getSeriesKey
in interfaceSeriesDataset
- Specified by:
getSeriesKey
in classAbstractSeriesDataset
- Parameters:
series
- the series index (in the range0
togetSeriesCount() - 1
).- Returns:
- The key for the series.
- Throws:
IllegalArgumentException
- ifseries
is not in the specified range.
-
getItemCount
Returns the number of items in the specified series.- Specified by:
getItemCount
in interfaceXYDataset
- Parameters:
series
- the series index (in the range0
togetSeriesCount() - 1
).- Returns:
- The item count.
- Throws:
IllegalArgumentException
- ifseries
is not in the specified range.
-
getXValue
Returns the x-value for an item within a series.- Specified by:
getXValue
in interfaceXYDataset
- Overrides:
getXValue
in classAbstractXYDataset
- Parameters:
series
- the series index (in the range0
togetSeriesCount() - 1
).item
- the item index (in the range0
togetItemCount(series)
).- Returns:
- The x-value.
- Throws:
ArrayIndexOutOfBoundsException
- ifseries
is not within the specified range.ArrayIndexOutOfBoundsException
- ifitem
is not within the specified range.- See Also:
-
getYValue
Returns the y-value for an item within a series.- Specified by:
getYValue
in interfaceXYDataset
- Overrides:
getYValue
in classAbstractXYDataset
- Parameters:
series
- the series index (in the range0
togetSeriesCount() - 1
).item
- the item index (in the range0
togetItemCount(series)
).- Returns:
- The y-value.
- Throws:
ArrayIndexOutOfBoundsException
- ifseries
is not within the specified range.ArrayIndexOutOfBoundsException
- ifitem
is not within the specified range.- See Also:
-
getStartXValue
Returns the starting x-value for an item within a series.- Specified by:
getStartXValue
in interfaceIntervalXYDataset
- Overrides:
getStartXValue
in classAbstractIntervalXYDataset
- Parameters:
series
- the series index (in the range0
togetSeriesCount() - 1
).item
- the item index (in the range0
togetItemCount(series)
).- Returns:
- The starting x-value.
- Throws:
ArrayIndexOutOfBoundsException
- ifseries
is not within the specified range.ArrayIndexOutOfBoundsException
- ifitem
is not within the specified range.- See Also:
-
getEndXValue
Returns the ending x-value for an item within a series.- Specified by:
getEndXValue
in interfaceIntervalXYDataset
- Overrides:
getEndXValue
in classAbstractIntervalXYDataset
- Parameters:
series
- the series index (in the range0
togetSeriesCount() - 1
).item
- the item index (in the range0
togetItemCount(series)
).- Returns:
- The ending x-value.
- Throws:
ArrayIndexOutOfBoundsException
- ifseries
is not within the specified range.ArrayIndexOutOfBoundsException
- ifitem
is not within the specified range.- See Also:
-
getStartYValue
Returns the starting y-value for an item within a series.- Specified by:
getStartYValue
in interfaceIntervalXYDataset
- Overrides:
getStartYValue
in classAbstractIntervalXYDataset
- Parameters:
series
- the series index (in the range0
togetSeriesCount() - 1
).item
- the item index (in the range0
togetItemCount(series)
).- Returns:
- The starting y-value.
- Throws:
ArrayIndexOutOfBoundsException
- ifseries
is not within the specified range.ArrayIndexOutOfBoundsException
- ifitem
is not within the specified range.- See Also:
-
getEndYValue
Returns the ending y-value for an item within a series.- Specified by:
getEndYValue
in interfaceIntervalXYDataset
- Overrides:
getEndYValue
in classAbstractIntervalXYDataset
- Parameters:
series
- the series index (in the range0
togetSeriesCount() - 1
).item
- the item index (in the range0
togetItemCount(series)
).- Returns:
- The ending y-value.
- Throws:
ArrayIndexOutOfBoundsException
- ifseries
is not within the specified range.ArrayIndexOutOfBoundsException
- ifitem
is not within the specified range.- See Also:
-
getEndX
Returns the ending x-value for an item within a series.- Specified by:
getEndX
in interfaceIntervalXYDataset
- Parameters:
series
- the series index (in the range0
togetSeriesCount() - 1
).item
- the item index (in the range0
togetItemCount(series)
).- Returns:
- The ending x-value.
- Throws:
ArrayIndexOutOfBoundsException
- ifseries
is not within the specified range.ArrayIndexOutOfBoundsException
- ifitem
is not within the specified range.- See Also:
-
getEndY
Returns the ending y-value for an item within a series.- Specified by:
getEndY
in interfaceIntervalXYDataset
- Parameters:
series
- the series index (in the range0
togetSeriesCount() - 1
).item
- the item index (in the range0
togetItemCount(series)
).- Returns:
- The ending y-value.
- Throws:
ArrayIndexOutOfBoundsException
- ifseries
is not within the specified range.ArrayIndexOutOfBoundsException
- ifitem
is not within the specified range.- See Also:
-
getStartX
Returns the starting x-value for an item within a series.- Specified by:
getStartX
in interfaceIntervalXYDataset
- Parameters:
series
- the series index (in the range0
togetSeriesCount() - 1
).item
- the item index (in the range0
togetItemCount(series)
).- Returns:
- The starting x-value.
- Throws:
ArrayIndexOutOfBoundsException
- ifseries
is not within the specified range.ArrayIndexOutOfBoundsException
- ifitem
is not within the specified range.- See Also:
-
getStartY
Returns the starting y-value for an item within a series.- Specified by:
getStartY
in interfaceIntervalXYDataset
- Parameters:
series
- the series index (in the range0
togetSeriesCount() - 1
).item
- the item index (in the range0
togetItemCount(series)
).- Returns:
- The starting y-value.
- Throws:
ArrayIndexOutOfBoundsException
- ifseries
is not within the specified range.ArrayIndexOutOfBoundsException
- ifitem
is not within the specified range.- See Also:
-
getX
Returns the x-value for an item within a series.- Specified by:
getX
in interfaceXYDataset
- Parameters:
series
- the series index (in the range0
togetSeriesCount() - 1
).item
- the item index (in the range0
togetItemCount(series)
).- Returns:
- The x-value.
- Throws:
ArrayIndexOutOfBoundsException
- ifseries
is not within the specified range.ArrayIndexOutOfBoundsException
- ifitem
is not within the specified range.- See Also:
-
getY
Returns the y-value for an item within a series.- Specified by:
getY
in interfaceXYDataset
- Parameters:
series
- the series index (in the range0
togetSeriesCount() - 1
).item
- the item index (in the range0
togetItemCount(series)
).- Returns:
- The y-value.
- Throws:
ArrayIndexOutOfBoundsException
- ifseries
is not within the specified range.ArrayIndexOutOfBoundsException
- ifitem
is 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 aDatasetChangeEvent
to all registered listeners.- Parameters:
seriesKey
- the series key (null
not 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 thisDefaultIntervalXYDataset
instance for equality with an arbitrary object. This method returnstrue
if and only if:obj
is notnull
;obj
is an instance ofDefaultIntervalXYDataset
;- both datasets have the same number of series, each containing exactly the same values.
- Overrides:
equals
in classAbstractDataset
- Parameters:
obj
- the object (null
permitted).- Returns:
- A boolean.
-
hashCode
Returns a hash code for this instance.- Overrides:
hashCode
in classAbstractDataset
- Returns:
- A hash code.
-
clone
Returns a clone of this dataset.- Specified by:
clone
in interfacePublicCloneable
- Overrides:
clone
in classAbstractDataset
- Returns:
- A clone.
- Throws:
CloneNotSupportedException
- if the dataset contains a series with a key that cannot be cloned.
-