org.jfree.data.xy

Class DefaultIntervalXYDataset

public class DefaultIntervalXYDataset extends AbstractIntervalXYDataset implements PublicCloneable

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 IntervalXYDataset interface is provided by the XYIntervalSeriesCollection class.

Since: 1.0.3

Constructor Summary
DefaultIntervalXYDataset()
Creates a new DefaultIntervalXYDataset instance, initially containing no data.
Method Summary
voidaddSeries(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 a DatasetChangeEvent to all registered listeners.
Objectclone()
Returns a clone of this dataset.
booleanequals(Object obj)
Tests this DefaultIntervalXYDataset instance for equality with an arbitrary object.
NumbergetEndX(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.
NumbergetEndY(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.
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 an item within a series.
doublegetStartXValue(int series, int item)
Returns the starting x-value for an item within a series.
NumbergetStartY(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.
NumbergetX(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.
NumbergetY(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.

Constructor Detail

DefaultIntervalXYDataset

public DefaultIntervalXYDataset()
Creates a new DefaultIntervalXYDataset instance, initially containing no data.

Method Detail

addSeries

public void 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 a DatasetChangeEvent 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 containing the x-values and the second containing the y-values).

clone

public Object clone()
Returns a clone of this dataset.

Returns: A clone.

Throws: CloneNotSupportedException if the dataset contains a series with a key that cannot be cloned.

equals

public boolean equals(Object obj)
Tests this DefaultIntervalXYDataset instance for equality with an arbitrary object. This method returns true if and only if:

Parameters: obj the object (null permitted).

Returns: A boolean.

getEndX

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

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

Returns: The ending x-value.

Throws: ArrayIndexOutOfBoundsException if series is not within the specified range. ArrayIndexOutOfBoundsException if item is not within the specified range.

See Also: DefaultIntervalXYDataset

getEndXValue

public double getEndXValue(int series, int item)
Returns the ending x-value for an item within a series.

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

Returns: The ending x-value.

Throws: ArrayIndexOutOfBoundsException if series is not within the specified range. ArrayIndexOutOfBoundsException if item is not within the specified range.

See Also: DefaultIntervalXYDataset

getEndY

public Number getEndY(int series, int item)
Returns the ending y-value for an item within a series.

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

Returns: The ending y-value.

Throws: ArrayIndexOutOfBoundsException if series is not within the specified range. ArrayIndexOutOfBoundsException if item is not within the specified range.

See Also: DefaultIntervalXYDataset

getEndYValue

public double getEndYValue(int series, int item)
Returns the ending y-value for an item within a series.

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

Returns: The ending y-value.

Throws: ArrayIndexOutOfBoundsException if series is not within the specified range. ArrayIndexOutOfBoundsException if item is not within the specified range.

See Also: DefaultIntervalXYDataset

getItemCount

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

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

Returns: The item count.

Throws: IllegalArgumentException if series is not in the specified range.

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 key for the series.

Throws: IllegalArgumentException if series is not in the specified range.

getStartX

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

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

Returns: The starting x-value.

Throws: ArrayIndexOutOfBoundsException if series is not within the specified range. ArrayIndexOutOfBoundsException if item is not within the specified range.

See Also: DefaultIntervalXYDataset

getStartXValue

public double getStartXValue(int series, int item)
Returns the starting x-value for an item within a series.

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

Returns: The starting x-value.

Throws: ArrayIndexOutOfBoundsException if series is not within the specified range. ArrayIndexOutOfBoundsException if item is not within the specified range.

See Also: DefaultIntervalXYDataset

getStartY

public Number getStartY(int series, int item)
Returns the starting y-value for an item within a series.

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

Returns: The starting y-value.

Throws: ArrayIndexOutOfBoundsException if series is not within the specified range. ArrayIndexOutOfBoundsException if item is not within the specified range.

See Also: DefaultIntervalXYDataset

getStartYValue

public double getStartYValue(int series, int item)
Returns the starting y-value for an item within a series.

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

Returns: The starting y-value.

Throws: ArrayIndexOutOfBoundsException if series is not within the specified range. ArrayIndexOutOfBoundsException if item is not within the specified range.

See Also: DefaultIntervalXYDataset

getX

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

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

Returns: The x-value.

Throws: ArrayIndexOutOfBoundsException if series is not within the specified range. ArrayIndexOutOfBoundsException if item is not within the specified range.

See Also: DefaultIntervalXYDataset

getXValue

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

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

Returns: The x-value.

Throws: ArrayIndexOutOfBoundsException if series is not within the specified range. ArrayIndexOutOfBoundsException if item is not within the specified range.

See Also: DefaultIntervalXYDataset

getY

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

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

Returns: The y-value.

Throws: ArrayIndexOutOfBoundsException if series is not within the specified range. ArrayIndexOutOfBoundsException if item is not within the specified range.

See Also: DefaultIntervalXYDataset

getYValue

public double getYValue(int series, int item)
Returns the y-value for an item within a series.

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

Returns: The y-value.

Throws: ArrayIndexOutOfBoundsException if series is not within the specified range. ArrayIndexOutOfBoundsException if item is not within the specified range.

See Also: DefaultIntervalXYDataset

hashCode

public int hashCode()
Returns a hash code for this instance.

Returns: A hash code.