Package org.jfree.data.time.ohlc
Class OHLCSeriesCollection
java.lang.Object
org.jfree.data.general.AbstractDataset
org.jfree.data.general.AbstractSeriesDataset
org.jfree.data.xy.AbstractXYDataset
org.jfree.data.time.ohlc.OHLCSeriesCollection
- All Implemented Interfaces:
ObjectInputValidation,Serializable,Cloneable,EventListener,Dataset,SeriesChangeListener,SeriesDataset,OHLCDataset,XYDataset
A collection of
OHLCSeries objects.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSeries(OHLCSeries series) Adds a series to the collection and sends aDatasetChangeEventto all registered listeners.clone()Returns a clone of this instance.booleanTests this instance for equality with an arbitrary object.getClose(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.getHigh(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.getLow(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.getOpen(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.getSeries(int series) Returns a series from the collection.intReturns the number of series in the collection.getSeriesKey(int series) Returns the key for a series.getVolume(int series, int item) Returnsnullalways, because this dataset doesn't record any volume data.doublegetVolumeValue(int series, int item) ReturnsDouble.NaNalways, because this dataset doesn't record any volume data.getX(int series, int item) Returns the x-value for an item within a series.protected longgetX(RegularTimePeriod period) Returns the x-value for a time period.Returns the position within each time period that is used for the X value when the collection is used as anXYDataset.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.inthashCode()Returns a hash code for this instance.voidRemoves all the series from the collection and sends aDatasetChangeEventto all registered listeners.voidremoveSeries(int index) Removes the series with the specified index and sends aDatasetChangeEventto all registered listeners.booleanremoveSeries(OHLCSeries series) Removes the specified series from the dataset and sends aDatasetChangeEventto all registered listeners.voidsetXPosition(TimePeriodAnchor anchor) Sets the position within each time period that is used for the X values when the collection is used as anXYDataset, then sends aDatasetChangeEventis sent to all registered listeners.Methods inherited from class org.jfree.data.xy.AbstractXYDataset
getDomainOrder, getYValueMethods inherited from class org.jfree.data.general.AbstractSeriesDataset
indexOf, seriesChangedMethods inherited from class org.jfree.data.general.AbstractDataset
addChangeListener, canEqual, 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, getYValue
-
Constructor Details
-
OHLCSeriesCollection
public OHLCSeriesCollection()Creates a new instance ofOHLCSeriesCollection.
-
-
Method Details
-
getXPosition
Returns the position within each time period that is used for the X value when the collection is used as anXYDataset.- Returns:
- The anchor position (never
null).
-
setXPosition
Sets the position within each time period that is used for the X values when the collection is used as anXYDataset, then sends aDatasetChangeEventis sent to all registered listeners.- Parameters:
anchor- the anchor position (nullnot permitted).
-
addSeries
Adds a series to the collection and sends aDatasetChangeEventto all registered listeners.- Parameters:
series- the series (nullnot permitted).
-
getSeriesCount
Returns the number of series in the collection.- Specified by:
getSeriesCountin interfaceSeriesDataset- Specified by:
getSeriesCountin classAbstractSeriesDataset- Returns:
- The series count.
-
getSeries
Returns a series from the collection.- Parameters:
series- the series index (zero-based).- Returns:
- The series.
- Throws:
IllegalArgumentException- ifseriesis not in the range0togetSeriesCount() - 1.
-
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 a series.
- Throws:
IllegalArgumentException- ifseriesis not in the specified range.
-
getItemCount
Returns the number of items in the specified series.- Specified by:
getItemCountin interfaceXYDataset- Parameters:
series- the series (zero-based index).- Returns:
- The item count.
- Throws:
IllegalArgumentException- ifseriesis not in the range0togetSeriesCount() - 1.
-
getX
Returns the x-value for a time period.- Parameters:
period- the time period (nullnot permitted).- Returns:
- The x-value.
-
getXValue
Returns the x-value for an item within a series.- Specified by:
getXValuein interfaceXYDataset- Overrides:
getXValuein classAbstractXYDataset- Parameters:
series- the series index.item- the item index.- Returns:
- The x-value.
-
getX
Returns the x-value for an item within a series. -
getY
Returns the y-value for an item within a series. -
getOpenValue
Returns the open-value for an item within a series.- Specified by:
getOpenValuein interfaceOHLCDataset- Parameters:
series- the series index.item- the item index.- Returns:
- The open-value.
-
getOpen
Returns the open-value for an item within a series.- Specified by:
getOpenin interfaceOHLCDataset- Parameters:
series- the series index.item- the item index.- Returns:
- The open-value.
-
getCloseValue
Returns the close-value for an item within a series.- Specified by:
getCloseValuein interfaceOHLCDataset- Parameters:
series- the series index.item- the item index.- Returns:
- The close-value.
-
getClose
Returns the close-value for an item within a series.- Specified by:
getClosein interfaceOHLCDataset- Parameters:
series- the series index.item- the item index.- Returns:
- The close-value.
-
getHighValue
Returns the high-value for an item within a series.- Specified by:
getHighValuein interfaceOHLCDataset- Parameters:
series- the series index.item- the item index.- Returns:
- The high-value.
-
getHigh
Returns the high-value for an item within a series.- Specified by:
getHighin interfaceOHLCDataset- Parameters:
series- the series index.item- the item index.- Returns:
- The high-value.
-
getLowValue
Returns the low-value for an item within a series.- Specified by:
getLowValuein interfaceOHLCDataset- Parameters:
series- the series index.item- the item index.- Returns:
- The low-value.
-
getLow
Returns the low-value for an item within a series.- Specified by:
getLowin interfaceOHLCDataset- Parameters:
series- the series index.item- the item index.- Returns:
- The low-value.
-
getVolume
Returnsnullalways, because this dataset doesn't record any volume data.- Specified by:
getVolumein interfaceOHLCDataset- Parameters:
series- the series index (ignored).item- the item index (ignored).- Returns:
null.
-
getVolumeValue
ReturnsDouble.NaNalways, because this dataset doesn't record any volume data.- Specified by:
getVolumeValuein interfaceOHLCDataset- Parameters:
series- the series index (ignored).item- the item index (ignored).- Returns:
Double.NaN.
-
removeSeries
Removes the series with the specified index and sends aDatasetChangeEventto all registered listeners.- Parameters:
index- the series index.
-
removeSeries
Removes the specified series from the dataset and sends aDatasetChangeEventto all registered listeners.- Parameters:
series- the series (nullnot permitted).- Returns:
trueif the series was removed, andfalseotherwise.
-
removeAllSeries
Removes all the series from the collection and sends aDatasetChangeEventto all registered listeners. -
equals
Tests this instance for equality with an arbitrary object.- Overrides:
equalsin classAbstractDataset- Parameters:
obj- the object (nullpermitted).- Returns:
- A boolean.
-
hashCode
Returns a hash code for this instance.- Overrides:
hashCodein classAbstractDataset- Returns:
- A hash code.
-
clone
Returns a clone of this instance.- Overrides:
clonein classAbstractDataset- Returns:
- A clone.
- Throws:
CloneNotSupportedException- if there is a problem.
-