public class DefaultOHLCDataset extends AbstractXYDataset implements OHLCDataset, org.jfree.util.PublicCloneable
OHLCDataset
interface. This
implementation supports only one series.Constructor and Description |
---|
DefaultOHLCDataset(java.lang.Comparable key,
OHLCDataItem[] data)
Creates a new dataset.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Returns an independent copy of this dataset.
|
boolean |
equals(java.lang.Object obj)
Tests this instance for equality with an arbitrary object.
|
java.lang.Number |
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.
|
java.lang.Number |
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.
|
java.lang.Number |
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.
|
java.lang.Number |
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 |
getSeriesCount()
Returns the series count.
|
java.lang.Comparable |
getSeriesKey(int series)
Returns the series key.
|
java.lang.Number |
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.
|
java.lang.Number |
getX(int series,
int item)
Returns the x-value for a data item.
|
java.util.Date |
getXDate(int series,
int item)
Returns the x-value for a data item as a date.
|
java.lang.Number |
getY(int series,
int item)
Returns the y-value.
|
void |
sortDataByDate()
Sorts the data into ascending order by date.
|
getDomainOrder, getXValue, getYValue
indexOf, seriesChanged
addChangeListener, fireDatasetChanged, getGroup, getNotify, hasListener, notifyListeners, removeChangeListener, setGroup, setNotify, validateObject
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDomainOrder, getXValue, getYValue
indexOf
addChangeListener, getGroup, removeChangeListener, setGroup
public DefaultOHLCDataset(java.lang.Comparable key, OHLCDataItem[] data)
key
- the series key.data
- the data items.public java.lang.Comparable getSeriesKey(int series)
getSeriesKey
in interface SeriesDataset
getSeriesKey
in class AbstractSeriesDataset
series
- the series index (ignored).public java.lang.Number getX(int series, int item)
public java.util.Date getXDate(int series, int item)
series
- the series index (ignored).item
- the item index (zero-based).public java.lang.Number getY(int series, int item)
public java.lang.Number getHigh(int series, int item)
getHigh
in interface OHLCDataset
series
- the series index (ignored).item
- the item index (zero-based).public double getHighValue(int series, int item)
getHighValue
in interface OHLCDataset
series
- the series (zero-based index).item
- the item (zero-based index).public java.lang.Number getLow(int series, int item)
getLow
in interface OHLCDataset
series
- the series index (ignored).item
- the item index (zero-based).public double getLowValue(int series, int item)
getLowValue
in interface OHLCDataset
series
- the series (zero-based index).item
- the item (zero-based index).public java.lang.Number getOpen(int series, int item)
getOpen
in interface OHLCDataset
series
- the series index (ignored).item
- the item index (zero-based).public double getOpenValue(int series, int item)
getOpenValue
in interface OHLCDataset
series
- the series (zero-based index).item
- the item (zero-based index).public java.lang.Number getClose(int series, int item)
getClose
in interface OHLCDataset
series
- the series index (ignored).item
- the item index (zero-based).public double getCloseValue(int series, int item)
getCloseValue
in interface OHLCDataset
series
- the series (zero-based index).item
- the item (zero-based index).public java.lang.Number getVolume(int series, int item)
getVolume
in interface OHLCDataset
series
- the series index (ignored).item
- the item index (zero-based).public double getVolumeValue(int series, int item)
getVolumeValue
in interface OHLCDataset
series
- the series (zero-based index).item
- the item (zero-based index).public int getSeriesCount()
getSeriesCount
in interface SeriesDataset
getSeriesCount
in class AbstractSeriesDataset
public int getItemCount(int series)
getItemCount
in interface XYDataset
series
- the series index (ignored).public void sortDataByDate()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the object (null
permitted).public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in interface org.jfree.util.PublicCloneable
clone
in class AbstractDataset
java.lang.CloneNotSupportedException
- if there is a cloning problem.