Package org.jfree.data.xy
Class DefaultOHLCDataset
java.lang.Object
org.jfree.data.general.AbstractDataset
org.jfree.data.general.AbstractSeriesDataset
org.jfree.data.xy.AbstractXYDataset
org.jfree.data.xy.DefaultOHLCDataset
- All Implemented Interfaces:
ObjectInputValidation,Serializable,Cloneable,EventListener,PublicCloneable,Dataset,SeriesChangeListener,SeriesDataset,OHLCDataset,XYDataset
A simple implementation of the
OHLCDataset interface. This
implementation supports only one series.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultOHLCDataset(Comparable key, OHLCDataItem[] data) Creates a new dataset. -
Method Summary
Modifier and TypeMethodDescriptionclone()Returns an independent copy of this dataset.booleanTests this instance for equality with an arbitrary object.getClose(int series, int item) Returns the close value.doublegetCloseValue(int series, int item) Returns the close-value (as a double primitive) for an item within a series.getHigh(int series, int item) Returns the high value.doublegetHighValue(int series, int item) Returns the high-value (as a double primitive) for an item within a series.intgetItemCount(int series) Returns the item count for the specified series.getLow(int series, int item) Returns the low value.doublegetLowValue(int series, int item) Returns the low-value (as a double primitive) for an item within a series.getOpen(int series, int item) Returns the open value.doublegetOpenValue(int series, int item) Returns the open-value (as a double primitive) for an item within a series.intReturns the series count.getSeriesKey(int series) Returns the series key.getVolume(int series, int item) Returns the trading volume.doublegetVolumeValue(int series, int item) Returns the volume-value (as a double primitive) for an item within a series.getX(int series, int item) Returns the x-value for a data item.getXDate(int series, int item) Returns the x-value for a data item as a date.getY(int series, int item) Returns the y-value.voidSorts the data into ascending order by date.Methods inherited from class org.jfree.data.xy.AbstractXYDataset
getDomainOrder, getXValue, getYValueMethods inherited from class org.jfree.data.general.AbstractSeriesDataset
indexOf, seriesChangedMethods inherited from class org.jfree.data.general.AbstractDataset
addChangeListener, canEqual, fireDatasetChanged, getGroup, getNotify, hashCode, 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, getXValue, getYValue
-
Constructor Details
-
DefaultOHLCDataset
Creates a new dataset.- Parameters:
key- the series key.data- the data items.
-
-
Method Details
-
getSeriesKey
Returns the series key.- Specified by:
getSeriesKeyin interfaceSeriesDataset- Specified by:
getSeriesKeyin classAbstractSeriesDataset- Parameters:
series- the series index (ignored).- Returns:
- The series key.
-
getX
Returns the x-value for a data item. -
getXDate
Returns the x-value for a data item as a date.- Parameters:
series- the series index (ignored).item- the item index (zero-based).- Returns:
- The x-value as a date.
-
getY
Returns the y-value. -
getHigh
Returns the high value.- Specified by:
getHighin interfaceOHLCDataset- Parameters:
series- the series index (ignored).item- the item index (zero-based).- Returns:
- The high value.
-
getHighValue
Returns the high-value (as a double primitive) for an item within a series.- Specified by:
getHighValuein interfaceOHLCDataset- Parameters:
series- the series (zero-based index).item- the item (zero-based index).- Returns:
- The high-value.
-
getLow
Returns the low value.- Specified by:
getLowin interfaceOHLCDataset- Parameters:
series- the series index (ignored).item- the item index (zero-based).- Returns:
- The low value.
-
getLowValue
Returns the low-value (as a double primitive) for an item within a series.- Specified by:
getLowValuein interfaceOHLCDataset- Parameters:
series- the series (zero-based index).item- the item (zero-based index).- Returns:
- The low-value.
-
getOpen
Returns the open value.- Specified by:
getOpenin interfaceOHLCDataset- Parameters:
series- the series index (ignored).item- the item index (zero-based).- Returns:
- The open value.
-
getOpenValue
Returns the open-value (as a double primitive) for an item within a series.- Specified by:
getOpenValuein interfaceOHLCDataset- Parameters:
series- the series (zero-based index).item- the item (zero-based index).- Returns:
- The open-value.
-
getClose
Returns the close value.- Specified by:
getClosein interfaceOHLCDataset- Parameters:
series- the series index (ignored).item- the item index (zero-based).- Returns:
- The close value.
-
getCloseValue
Returns the close-value (as a double primitive) for an item within a series.- Specified by:
getCloseValuein interfaceOHLCDataset- Parameters:
series- the series (zero-based index).item- the item (zero-based index).- Returns:
- The close-value.
-
getVolume
Returns the trading volume.- Specified by:
getVolumein interfaceOHLCDataset- Parameters:
series- the series index (ignored).item- the item index (zero-based).- Returns:
- The trading volume.
-
getVolumeValue
Returns the volume-value (as a double primitive) for an item within a series.- Specified by:
getVolumeValuein interfaceOHLCDataset- Parameters:
series- the series (zero-based index).item- the item (zero-based index).- Returns:
- The volume-value.
-
getSeriesCount
Returns the series count.- Specified by:
getSeriesCountin interfaceSeriesDataset- Specified by:
getSeriesCountin classAbstractSeriesDataset- Returns:
- 1.
-
getItemCount
Returns the item count for the specified series.- Specified by:
getItemCountin interfaceXYDataset- Parameters:
series- the series index (ignored).- Returns:
- The item count.
-
sortDataByDate
Sorts the data into ascending order by date. -
equals
Tests this instance for equality with an arbitrary object.- Overrides:
equalsin classAbstractDataset- Parameters:
obj- the object (nullpermitted).- Returns:
- A boolean.
-
clone
Returns an independent copy of this dataset.- Specified by:
clonein interfacePublicCloneable- Overrides:
clonein classAbstractDataset- Returns:
- A clone.
- Throws:
CloneNotSupportedException- if there is a cloning problem.
-