public class DefaultHighLowDataset extends AbstractXYDataset implements OHLCDataset, org.jfree.util.PublicCloneable
OHLCDataset
interface. See also
the DefaultOHLCDataset
class, which provides another implementation
that is very similar.Constructor and Description |
---|
DefaultHighLowDataset(java.lang.Comparable seriesKey,
java.util.Date[] date,
double[] high,
double[] low,
double[] open,
double[] close,
double[] volume)
Constructs a new high/low/open/close dataset.
|
Modifier and Type | Method and Description |
---|---|
static java.lang.Number[] |
createNumberArray(double[] data)
Constructs an array of Number objects from an array of doubles.
|
boolean |
equals(java.lang.Object obj)
Tests this dataset for equality with an arbitrary instance.
|
java.lang.Number |
getClose(int series,
int item)
Returns the close-value for one item in a series.
|
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 for one item in a series.
|
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 number of items in the specified series.
|
java.lang.Number |
getLow(int series,
int item)
Returns the low-value for one item in a series.
|
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 for one item in a series.
|
double |
getOpenValue(int series,
int item)
Returns the open-value (as a double primitive) for an item within a
series.
|
int |
getSeriesCount()
Returns the number of series in the dataset.
|
java.lang.Comparable |
getSeriesKey(int series)
Returns the key for the series stored in this dataset.
|
java.lang.Number |
getVolume(int series,
int item)
Returns the volume-value for one item in a series.
|
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 one item in a series.
|
java.util.Date |
getXDate(int series,
int item)
Returns the x-value for one item in a series, as a Date.
|
java.lang.Number |
getY(int series,
int item)
Returns the y-value for one item in a series.
|
getDomainOrder, getXValue, getYValue
indexOf, seriesChanged
addChangeListener, clone, 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 DefaultHighLowDataset(java.lang.Comparable seriesKey, java.util.Date[] date, double[] high, double[] low, double[] open, double[] close, double[] volume)
The current implementation allows only one series in the dataset. This may be extended in a future version.
seriesKey
- the key for the series (null
not
permitted).date
- the dates (null
not permitted).high
- the high values (null
not permitted).low
- the low values (null
not permitted).open
- the open values (null
not permitted).close
- the close values (null
not permitted).volume
- the volume values (null
not permitted).public java.lang.Comparable getSeriesKey(int series)
getSeriesKey
in interface SeriesDataset
getSeriesKey
in class AbstractSeriesDataset
series
- the index of the series (ignored, this dataset supports
only one series and this method always returns the key for series 0).null
).public java.lang.Number getX(int series, int item)
Long
instance generated from the underlying
Date
object. To avoid generating a new object instance,
you might prefer to call AbstractXYDataset.getXValue(int, int)
.getX
in interface XYDataset
series
- the series (zero-based index).item
- the item (zero-based index).AbstractXYDataset.getXValue(int, int)
,
getXDate(int, int)
public java.util.Date getXDate(int series, int item)
This method is provided for convenience only.
series
- the series (zero-based index).item
- the item (zero-based index).getX(int, int)
public java.lang.Number getY(int series, int item)
This method (from the XYDataset
interface) is mapped to the
getCloseValue(int, int)
method.
getY
in interface XYDataset
series
- the series (zero-based index).item
- the item (zero-based index).AbstractXYDataset.getYValue(int, int)
public java.lang.Number getHigh(int series, int item)
getHigh
in interface OHLCDataset
series
- the series (zero-based index).item
- the item (zero-based index).getHighValue(int, int)
public double getHighValue(int series, int item)
getHighValue
in interface OHLCDataset
series
- the series (zero-based index).item
- the item (zero-based index).getHigh(int, int)
public java.lang.Number getLow(int series, int item)
getLow
in interface OHLCDataset
series
- the series (zero-based index).item
- the item (zero-based index).getLowValue(int, int)
public double getLowValue(int series, int item)
getLowValue
in interface OHLCDataset
series
- the series (zero-based index).item
- the item (zero-based index).getLow(int, int)
public java.lang.Number getOpen(int series, int item)
getOpen
in interface OHLCDataset
series
- the series (zero-based index).item
- the item (zero-based index).getOpenValue(int, int)
public double getOpenValue(int series, int item)
getOpenValue
in interface OHLCDataset
series
- the series (zero-based index).item
- the item (zero-based index).getOpen(int, int)
public java.lang.Number getClose(int series, int item)
getClose
in interface OHLCDataset
series
- the series (zero-based index).item
- the item (zero-based index).getCloseValue(int, int)
public double getCloseValue(int series, int item)
getCloseValue
in interface OHLCDataset
series
- the series (zero-based index).item
- the item (zero-based index).getClose(int, int)
public java.lang.Number getVolume(int series, int item)
getVolume
in interface OHLCDataset
series
- the series (zero-based index).item
- the item (zero-based index).getVolumeValue(int, int)
public double getVolumeValue(int series, int item)
getVolumeValue
in interface OHLCDataset
series
- the series (zero-based index).item
- the item (zero-based index).getVolume(int, int)
public int getSeriesCount()
This implementation only allows one series.
getSeriesCount
in interface SeriesDataset
getSeriesCount
in class AbstractSeriesDataset
public int getItemCount(int series)
getItemCount
in interface XYDataset
series
- the index (zero-based) of the series.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the object (null
permitted).public static java.lang.Number[] createNumberArray(double[] data)
data
- the double values to convert (null
not
permitted).