Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.jfree.data.general.AbstractDataset
org.jfree.data.general.AbstractSeriesDataset
org.jfree.data.xy.AbstractXYDataset
org.jfree.data.xy.DefaultHighLowDataset
OHLCDataset
interface. See also
the DefaultOHLCDataset
class, which provides another implementation
that is very similar.
Constructor Summary | |
|
Method Summary | |
static Number[] |
|
boolean |
|
Number |
|
double |
|
Number |
|
double |
|
int |
|
Number |
|
double |
|
Number |
|
double |
|
int |
|
Comparable |
|
Number |
|
double |
|
Number |
|
Date |
|
Number |
|
Methods inherited from class org.jfree.data.xy.AbstractXYDataset | |
getDomainOrder , getXValue , getYValue |
Methods inherited from class org.jfree.data.general.AbstractSeriesDataset | |
getSeriesCount , getSeriesKey , indexOf , seriesChanged |
Methods inherited from class org.jfree.data.general.AbstractDataset | |
addChangeListener , clone , fireDatasetChanged , getGroup , hasListener , notifyListeners , removeChangeListener , setGroup , validateObject |
public DefaultHighLowDataset(Comparable seriesKey, Date[] date, double[] high, double[] low, double[] open, double[] close, double[] volume)
Constructs a new high/low/open/close dataset. The current implementation allows only one series in the dataset. This may be extended in a future version.
- Parameters:
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 static Number[] createNumberArray(double[] data)
Constructs an array of Number objects from an array of doubles.
- Parameters:
data
- the double values to convert (null
not permitted).
- Returns:
- The data as an array of Number objects.
public boolean equals(Object obj)
Tests this dataset for equality with an arbitrary instance.
- Parameters:
obj
- the object (null
permitted).
- Returns:
- A boolean.
public Number getClose(int series, int item)
Returns the close-value for one item in a series.
- Specified by:
- getClose in interface OHLCDataset
- Parameters:
series
- the series (zero-based index).item
- the item (zero-based index).
- Returns:
- The close-value.
- See Also:
getCloseValue(int,int)
public double getCloseValue(int series, int item)
Returns the close-value (as a double primitive) for an item within a series.
- Specified by:
- getCloseValue in interface OHLCDataset
- Parameters:
series
- the series (zero-based index).item
- the item (zero-based index).
- Returns:
- The close-value.
- See Also:
getClose(int,int)
public Number getHigh(int series, int item)
Returns the high-value for one item in a series.
- Specified by:
- getHigh in interface OHLCDataset
- Parameters:
series
- the series (zero-based index).item
- the item (zero-based index).
- Returns:
- The high-value.
- See Also:
getHighValue(int,int)
public double getHighValue(int series, int item)
Returns the high-value (as a double primitive) for an item within a series.
- Specified by:
- getHighValue in interface OHLCDataset
- Parameters:
series
- the series (zero-based index).item
- the item (zero-based index).
- Returns:
- The high-value.
- See Also:
getHigh(int,int)
public int getItemCount(int series)
Returns the number of items in the specified series.
- Specified by:
- getItemCount in interface XYDataset
- Parameters:
series
- the index (zero-based) of the series.
- Returns:
- The number of items in the specified series.
public Number getLow(int series, int item)
Returns the low-value for one item in a series.
- Specified by:
- getLow in interface OHLCDataset
- Parameters:
series
- the series (zero-based index).item
- the item (zero-based index).
- Returns:
- The low-value.
- See Also:
getLowValue(int,int)
public double getLowValue(int series, int item)
Returns the low-value (as a double primitive) for an item within a series.
- Specified by:
- getLowValue in interface OHLCDataset
- Parameters:
series
- the series (zero-based index).item
- the item (zero-based index).
- Returns:
- The low-value.
- See Also:
getLow(int,int)
public Number getOpen(int series, int item)
Returns the open-value for one item in a series.
- Specified by:
- getOpen in interface OHLCDataset
- Parameters:
series
- the series (zero-based index).item
- the item (zero-based index).
- Returns:
- The open-value.
- See Also:
getOpenValue(int,int)
public double getOpenValue(int series, int item)
Returns the open-value (as a double primitive) for an item within a series.
- Specified by:
- getOpenValue in interface OHLCDataset
- Parameters:
series
- the series (zero-based index).item
- the item (zero-based index).
- Returns:
- The open-value.
- See Also:
getOpen(int,int)
public int getSeriesCount()
Returns the number of series in the dataset. This implementation only allows one series.
- Specified by:
- getSeriesCount in interface SeriesDataset
- Overrides:
- getSeriesCount in interface AbstractSeriesDataset
- Returns:
- The number of series.
public Comparable getSeriesKey(int series)
Returns the key for the series stored in this dataset.
- Specified by:
- getSeriesKey in interface SeriesDataset
- Overrides:
- getSeriesKey in interface AbstractSeriesDataset
- Parameters:
series
- the index of the series (ignored, this dataset supports only one series and this method always returns the key for series 0).
- Returns:
- The series key (never
null
).
public Number getVolume(int series, int item)
Returns the volume-value for one item in a series.
- Specified by:
- getVolume in interface OHLCDataset
- Parameters:
series
- the series (zero-based index).item
- the item (zero-based index).
- Returns:
- The volume-value.
- See Also:
getVolumeValue(int,int)
public double getVolumeValue(int series, int item)
Returns the volume-value (as a double primitive) for an item within a series.
- Specified by:
- getVolumeValue in interface OHLCDataset
- Parameters:
series
- the series (zero-based index).item
- the item (zero-based index).
- Returns:
- The volume-value.
- See Also:
getVolume(int,int)
public Number getX(int series, int item)
Returns the x-value for one item in a series. The value returned is aLong
instance generated from the underlyingDate
object. To avoid generating a new object instance, you might prefer to callgetXValue(int,int)
.
- Parameters:
series
- the series (zero-based index).item
- the item (zero-based index).
- Returns:
- The x-value.
- See Also:
getXValue(int,int)
,getXDate(int,int)
public Date getXDate(int series, int item)
Returns the x-value for one item in a series, as a Date. This method is provided for convenience only.
- Parameters:
series
- the series (zero-based index).item
- the item (zero-based index).
- Returns:
- The x-value as a Date.
- See Also:
getX(int,int)
public Number getY(int series, int item)
Returns the y-value for one item in a series. This method (from theXYDataset
interface) is mapped to thegetCloseValue(int,int)
method.
- Parameters:
series
- the series (zero-based index).item
- the item (zero-based index).
- Returns:
- The y-value.
- See Also:
getYValue(int,int)