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
ConstructorDescriptionDefaultOHLCDataset
(Comparable key, OHLCDataItem[] data) Creates a new dataset. -
Method Summary
Modifier and TypeMethodDescriptionclone()
Returns an independent copy of this dataset.boolean
Tests this instance for equality with an arbitrary object.getClose
(int series, int item) Returns the close value.double
getCloseValue
(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.double
getHighValue
(int series, int item) Returns the high-value (as a double primitive) for an item within a series.int
getItemCount
(int series) Returns the item count for the specified series.getLow
(int series, int item) Returns the low value.double
getLowValue
(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.double
getOpenValue
(int series, int item) Returns the open-value (as a double primitive) for an item within a series.int
Returns the series count.getSeriesKey
(int series) Returns the series key.getVolume
(int series, int item) Returns the trading volume.double
getVolumeValue
(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.void
Sorts the data into ascending order by date.Methods inherited from class org.jfree.data.xy.AbstractXYDataset
getDomainOrder, getXValue, getYValue
Methods inherited from class org.jfree.data.general.AbstractSeriesDataset
indexOf, seriesChanged
Methods inherited from class org.jfree.data.general.AbstractDataset
addChangeListener, canEqual, fireDatasetChanged, getGroup, getNotify, hashCode, hasListener, notifyListeners, removeChangeListener, setGroup, setNotify, validateObject
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.jfree.data.general.Dataset
addChangeListener, getGroup, removeChangeListener, setGroup
Methods inherited from interface org.jfree.data.general.SeriesDataset
indexOf
Methods 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:
getSeriesKey
in interfaceSeriesDataset
- Specified by:
getSeriesKey
in 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:
getHigh
in 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:
getHighValue
in 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:
getLow
in 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:
getLowValue
in 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:
getOpen
in 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:
getOpenValue
in 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:
getClose
in 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:
getCloseValue
in 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:
getVolume
in 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:
getVolumeValue
in 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:
getSeriesCount
in interfaceSeriesDataset
- Specified by:
getSeriesCount
in classAbstractSeriesDataset
- Returns:
- 1.
-
getItemCount
Returns the item count for the specified series.- Specified by:
getItemCount
in 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:
equals
in classAbstractDataset
- Parameters:
obj
- the object (null
permitted).- Returns:
- A boolean.
-
clone
Returns an independent copy of this dataset.- Specified by:
clone
in interfacePublicCloneable
- Overrides:
clone
in classAbstractDataset
- Returns:
- A clone.
- Throws:
CloneNotSupportedException
- if there is a cloning problem.
-