org.jfree.data.time.ohlc

Class OHLCSeriesCollection

public class OHLCSeriesCollection extends AbstractXYDataset implements OHLCDataset, Serializable

A collection of OHLCSeries objects.

Since: 1.0.4

See Also: OHLCSeries

Constructor Summary
OHLCSeriesCollection()
Creates a new instance of OHLCSeriesCollection.
Method Summary
voidaddSeries(OHLCSeries series)
Adds a series to the collection and sends a DatasetChangeEvent to all registered listeners.
Objectclone()
Returns a clone of this instance.
booleanequals(Object obj)
Tests this instance for equality with an arbitrary object.
NumbergetClose(int series, int item)
Returns the close-value for an item within a series.
doublegetCloseValue(int series, int item)
Returns the close-value for an item within a series.
NumbergetHigh(int series, int item)
Returns the high-value for an item within a series.
doublegetHighValue(int series, int item)
Returns the high-value for an item within a series.
intgetItemCount(int series)
Returns the number of items in the specified series.
NumbergetLow(int series, int item)
Returns the low-value for an item within a series.
doublegetLowValue(int series, int item)
Returns the low-value for an item within a series.
NumbergetOpen(int series, int item)
Returns the open-value for an item within a series.
doublegetOpenValue(int series, int item)
Returns the open-value for an item within a series.
OHLCSeriesgetSeries(int series)
Returns a series from the collection.
intgetSeriesCount()
Returns the number of series in the collection.
ComparablegetSeriesKey(int series)
Returns the key for a series.
NumbergetVolume(int series, int item)
Returns null always, because this dataset doesn't record any volume data.
doublegetVolumeValue(int series, int item)
Returns Double.NaN always, because this dataset doesn't record any volume data.
protected longgetX(RegularTimePeriod period)
Returns the x-value for a time period.
NumbergetX(int series, int item)
Returns the x-value for an item within a series.
TimePeriodAnchorgetXPosition()
Returns the position within each time period that is used for the X value when the collection is used as an XYDataset.
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.
voidsetXPosition(TimePeriodAnchor anchor)
Sets the position within each time period that is used for the X values when the collection is used as an XYDataset, then sends a DatasetChangeEvent is sent to all registered listeners.

Constructor Detail

OHLCSeriesCollection

public OHLCSeriesCollection()
Creates a new instance of OHLCSeriesCollection.

Method Detail

addSeries

public void addSeries(OHLCSeries series)
Adds a series to the collection and sends a DatasetChangeEvent to all registered listeners.

Parameters: series the series (null not permitted).

clone

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

Returns: A clone.

Throws: CloneNotSupportedException if there is a problem.

equals

public boolean equals(Object obj)
Tests this instance for equality with an arbitrary object.

Parameters: obj the object (null permitted).

Returns: A boolean.

getClose

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

Parameters: series the series index. item the item index.

Returns: The close-value.

getCloseValue

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

Parameters: series the series index. item the item index.

Returns: The close-value.

getHigh

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

Parameters: series the series index. item the item index.

Returns: The high-value.

getHighValue

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

Parameters: series the series index. item the item index.

Returns: The high-value.

getItemCount

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

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

Returns: The item count.

Throws: IllegalArgumentException if series is not in the range 0 to getSeriesCount() - 1.

getLow

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

Parameters: series the series index. item the item index.

Returns: The low-value.

getLowValue

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

Parameters: series the series index. item the item index.

Returns: The low-value.

getOpen

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

Parameters: series the series index. item the item index.

Returns: The open-value.

getOpenValue

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

Parameters: series the series index. item the item index.

Returns: The open-value.

getSeries

public OHLCSeries getSeries(int series)
Returns a series from the collection.

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

Returns: The series.

Throws: IllegalArgumentException if series is not in the range 0 to getSeriesCount() - 1.

getSeriesCount

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

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 a series.

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

getVolume

public Number getVolume(int series, int item)
Returns null always, because this dataset doesn't record any volume data.

Parameters: series the series index (ignored). item the item index (ignored).

Returns: null.

getVolumeValue

public double getVolumeValue(int series, int item)
Returns Double.NaN always, because this dataset doesn't record any volume data.

Parameters: series the series index (ignored). item the item index (ignored).

Returns: Double.NaN.

getX

protected long getX(RegularTimePeriod period)
Returns the x-value for a time period.

Parameters: period the time period (null not permitted).

Returns: The x-value.

getX

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

Parameters: series the series index. item the item index.

Returns: The x-value.

getXPosition

public TimePeriodAnchor getXPosition()
Returns the position within each time period that is used for the X value when the collection is used as an XYDataset.

Returns: The anchor position (never null).

Since: 1.0.11

getXValue

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

Parameters: series the series index. item the item index.

Returns: The x-value.

getY

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

Parameters: series the series index. item the item index.

Returns: The y-value.

setXPosition

public void setXPosition(TimePeriodAnchor anchor)
Sets the position within each time period that is used for the X values when the collection is used as an XYDataset, then sends a DatasetChangeEvent is sent to all registered listeners.

Parameters: anchor the anchor position (null not permitted).

Since: 1.0.11

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