org.jfree.data.general

Class CombinedDataset

public class CombinedDataset extends AbstractIntervalXYDataset implements XYDataset, OHLCDataset, IntervalXYDataset, CombinationDataset

Deprecated: As of version 1.0.13. This class will be removed from JFreeChart 1.2.0 onwards. Anyone needing this facility will need to maintain it outside of JFreeChart.

This class can combine instances of XYDataset, OHLCDataset and IntervalXYDataset together exposing the union of all the series under one dataset.
Constructor Summary
CombinedDataset()
Default constructor for an empty combination.
CombinedDataset(SeriesDataset[] data)
Creates a CombinedDataset initialized with an array of SeriesDatasets.
Method Summary
voidadd(SeriesDataset data)
Adds one SeriesDataset to the combination.
voidadd(SeriesDataset[] data)
Adds an array of SeriesDataset's to the combination.
voidadd(SeriesDataset data, int series)
Adds one series from a SeriesDataset to the combination.
intgetChildPosition(Dataset child)
Returns the child position.
NumbergetClose(int series, int item)
Returns the close-value for the specified series and item.
doublegetCloseValue(int series, int item)
Returns the close-value (as a double primitive) for an item within a series.
NumbergetEndX(int series, int item)
Returns the ending X value for the specified series and item.
NumbergetEndY(int series, int item)
Returns the ending Y value for the specified series and item.
NumbergetHigh(int series, int item)
Returns the high-value for the specified series and item.
doublegetHighValue(int series, int item)
Returns the high-value (as a double primitive) for an item within a series.
intgetItemCount(int series)
Returns the number of items in a series.
NumbergetLow(int series, int item)
Returns the low-value for the specified series and item.
doublegetLowValue(int series, int item)
Returns the low-value (as a double primitive) for an item within a series.
int[]getMap()
Returns a map or indirect indexing form our series into parent's series.
NumbergetOpen(int series, int item)
Returns the open-value for the specified series and item.
doublegetOpenValue(int series, int item)
Returns the open-value (as a double primitive) for an item within a series.
SeriesDatasetgetParent()
Returns the parent Dataset of this combination.
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 the specified series and item.
NumbergetStartY(int series, int item)
Returns the starting Y value for the specified series and item.
NumbergetVolume(int series, int item)
Returns the volume value for the specified series and item.
doublegetVolumeValue(int series, int item)
Returns the volume-value (as a double primitive) for an item within a series.
NumbergetX(int series, int item)
Returns the X-value for the specified series and item.
NumbergetY(int series, int item)
Returns the Y-value for the specified series and item.

Constructor Detail

CombinedDataset

public CombinedDataset()
Default constructor for an empty combination.

CombinedDataset

public CombinedDataset(SeriesDataset[] data)
Creates a CombinedDataset initialized with an array of SeriesDatasets.

Parameters: data array of SeriesDataset that contains the SeriesDatasets to combine.

Method Detail

add

public void add(SeriesDataset data)
Adds one SeriesDataset to the combination. Listeners are notified of the change.

Parameters: data the SeriesDataset to add.

add

public void add(SeriesDataset[] data)
Adds an array of SeriesDataset's to the combination. Listeners are notified of the change.

Parameters: data array of SeriesDataset to add

add

public void add(SeriesDataset data, int series)
Adds one series from a SeriesDataset to the combination. Listeners are notified of the change.

Parameters: data the SeriesDataset where series is contained series series to add

getChildPosition

public int getChildPosition(Dataset child)
Returns the child position.

Parameters: child the child dataset.

Returns: The position.

getClose

public Number getClose(int series, int item)
Returns the close-value for the specified series and item.

Note: throws ClassCastException if the series is not from a OHLCDataset.

Parameters: series the index of the series of interest (zero-based). item the index of the item of interest (zero-based).

Returns: The close-value for the specified series and item.

getCloseValue

public double getCloseValue(int series, int item)
Returns the close-value (as a double primitive) for an item within a series.

Parameters: series the series (zero-based index). item the item (zero-based index).

Returns: The close-value.

getEndX

public Number getEndX(int series, int item)
Returns the ending X value for the specified series and item.

Parameters: series the index of the series of interest (zero-based). item the index of the item of interest (zero-based).

Returns: The value.

getEndY

public Number getEndY(int series, int item)
Returns the ending Y value for the specified series and item.

Parameters: series the index of the series of interest (zero-based). item the index of the item of interest (zero-based).

Returns: The ending Y value for the specified series and item.

getHigh

public Number getHigh(int series, int item)
Returns the high-value for the specified series and item.

Note: throws ClassCastException if the series is not from a OHLCDataset.

Parameters: series the index of the series of interest (zero-based). item the index of the item of interest (zero-based).

Returns: The high-value for the specified series and item.

getHighValue

public double getHighValue(int series, int item)
Returns the high-value (as a double primitive) for an item within a series.

Parameters: series the series (zero-based index). item the item (zero-based index).

Returns: The high-value.

getItemCount

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

Note: throws ClassCastException if the series is not from a XYDataset.

Parameters: series the index of the series of interest (zero-based).

Returns: The number of items in a series.

getLow

public Number getLow(int series, int item)
Returns the low-value for the specified series and item.

Note: throws ClassCastException if the series is not from a OHLCDataset.

Parameters: series the index of the series of interest (zero-based). item the index of the item of interest (zero-based).

Returns: The low-value for the specified series and item.

getLowValue

public double getLowValue(int series, int item)
Returns the low-value (as a double primitive) for an item within a series.

Parameters: series the series (zero-based index). item the item (zero-based index).

Returns: The low-value.

getMap

public int[] getMap()
Returns a map or indirect indexing form our series into parent's series. Prior to calling this method, the client should check getParent() to make sure the CombinationDataset uses the same parent. If not, the map returned by this method will be invalid or null.

Returns: A map or indirect indexing form our series into parent's series.

See Also: getParent

getOpen

public Number getOpen(int series, int item)
Returns the open-value for the specified series and item.

Note: throws ClassCastException if the series is not from a OHLCDataset.

Parameters: series the index of the series of interest (zero-based). item the index of the item of interest (zero-based).

Returns: The open-value for the specified series and item.

getOpenValue

public double getOpenValue(int series, int item)
Returns the open-value (as a double primitive) for an item within a series.

Parameters: series the series (zero-based index). item the item (zero-based index).

Returns: The open-value.

getParent

public SeriesDataset getParent()
Returns the parent Dataset of this combination. If there is more than one parent, or a child is found that is not a CombinationDataset, then returns null.

Returns: The parent Dataset of this combination or null.

getSeriesCount

public int getSeriesCount()
Returns the number of series in the dataset.

Returns: The number of series in the dataset.

getSeriesKey

public Comparable getSeriesKey(int series)
Returns the key for a series.

Parameters: series the series (zero-based index).

Returns: The key for a series.

getStartX

public Number getStartX(int series, int item)
Returns the starting X value for the specified series and item.

Parameters: series the index of the series of interest (zero-based). item the index of the item of interest (zero-based).

Returns: The value.

getStartY

public Number getStartY(int series, int item)
Returns the starting Y value for the specified series and item.

Parameters: series the index of the series of interest (zero-based). item the index of the item of interest (zero-based).

Returns: The starting Y value for the specified series and item.

getVolume

public Number getVolume(int series, int item)
Returns the volume value for the specified series and item.

Note: throws ClassCastException if the series is not from a OHLCDataset.

Parameters: series the index of the series of interest (zero-based). item the index of the item of interest (zero-based).

Returns: The volume value for the specified series and item.

getVolumeValue

public double getVolumeValue(int series, int item)
Returns the volume-value (as a double primitive) for an item within a series.

Parameters: series the series (zero-based index). item the item (zero-based index).

Returns: The volume-value.

getX

public Number getX(int series, int item)
Returns the X-value for the specified series and item.

Note: throws ClassCastException if the series is not from a XYDataset.

Parameters: series the index of the series of interest (zero-based). item the index of the item of interest (zero-based).

Returns: The X-value for the specified series and item.

getY

public Number getY(int series, int item)
Returns the Y-value for the specified series and item.

Note: throws ClassCastException if the series is not from a XYDataset.

Parameters: series the index of the series of interest (zero-based). item the index of the item of interest (zero-based).

Returns: The Y-value for the specified series and item.

Copyright © 2000-2009 by Object Refinery Limited. All Rights Reserved.