Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jfree.data
Class DefaultHighLowDataset

    java.lang.Object
      org.jfree.data.AbstractDataset
          org.jfree.data.AbstractSeriesDataset
              org.jfree.data.AbstractXYDataset
                  org.jfree.data.DefaultHighLowDataset

All Implemented Interfaces:
  java.lang.Cloneable, Dataset, java.util.EventListener, HighLowDataset, java.io.ObjectInputValidation, java.io.Serializable, SeriesChangeListener, SeriesDataset, XYDataset

public class DefaultHighLowDataset
extends AbstractXYDataset
implements HighLowDataset

A simple implementation of the `HighLowDataset`.

See Also:
  Serialized Form

Constructor Summary
`DefaultHighLowDataset(java.lang.String seriesName, java.util.Date[] date, double[] high, double[] low, double[] open, double[] close, double[] volume)` Constructs a new high/low/open/close dataset.

Method Summary
`static java.lang.Number[]` | `createNumberArray(double[] data)` Constructs an array of Number objects from an array of doubles.
`double` | `getClose(int series, int item)` Returns the close-value (as a double primitive) for an item within a series.
`java.lang.Number` | `getCloseValue(int series, int item)` Returns the close-value for one item in a series.
`double` | `getHigh(int series, int item)` Returns the high-value (as a double primitive) for an item within a series.
`java.lang.Number` | `getHighValue(int series, int item)` Returns the high-value for one item in a series.
`int` | `getItemCount(int series)` Returns the number of items in the specified series.
`double` | `getLow(int series, int item)` Returns the low-value (as a double primitive) for an item within a series.
`java.lang.Number` | `getLowValue(int series, int item)` Returns the low-value for one item in a series.
`double` | `getOpen(int series, int item)` Returns the open-value (as a double primitive) for an item within a series.
`java.lang.Number` | `getOpenValue(int series, int item)` Returns the open-value for one item in a series.
`int` | `getSeriesCount()` Returns the number of series in the dataset.
`java.lang.String` | `getSeriesName(int i)` Returns the name of the series stored in this dataset.
`double` | `getVolume(int series, int item)` Returns the volume-value (as a double primitive) for an item within a series.
`java.lang.Number` | `getVolumeValue(int series, int item)` Returns the volume-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` | `getXValue(int series, int item)` Returns the x-value for one item in a series.
`java.lang.Number` | `getYValue(int series, int item)` Returns the y-value for one item in a series.

Methods inherited from class org.jfree.data.AbstractXYDataset
`getX, getY`

Methods inherited from class org.jfree.data.AbstractSeriesDataset
`seriesChanged`

Methods inherited from class org.jfree.data.AbstractDataset
`addChangeListener, clone, fireDatasetChanged, getGroup, notifyListeners, removeChangeListener, setGroup, validateObject`

Methods inherited from class java.lang.Object
`equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface org.jfree.data.XYDataset
`getX, getY`

Methods inherited from interface org.jfree.data.Dataset
`addChangeListener, getGroup, removeChangeListener, setGroup`

Constructor Detail

### DefaultHighLowDataset

    public DefaultHighLowDataset(java.lang.String seriesName,
                                 java.util.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:
  `seriesName` - the name of the series.
  `date` - the dates.
  `high` - the high values.
  `low` - the low values.
  `open` - the open values.
  `close` - the close values.
  `volume` - the volume values.

Method Detail

### getSeriesName

    public java.lang.String getSeriesName(int i)

  Returns the name of the series stored in this dataset.

  Specified by:
    `getSeriesName` in interface `SeriesDataset`
  Specified by:
    `getSeriesName` in class `AbstractSeriesDataset`
  Parameters:
    `i` - the index of the series. Currently ignored.
  Returns:
    the name of this series.

### getXValue

    public java.lang.Number getXValue(int series,
                                      int item)

  Returns the x-value for one item in a series.

  The value returned is a Long object generated from the underlying Date object.

  Specified by:
    `getXValue` in interface `XYDataset`
  Parameters:
    `series` - the series (zero-based index).
    `item` - the item (zero-based index).
  Returns:
    the x-value.

### getXDate

    public java.util.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.

### getYValue

    public java.lang.Number getYValue(int series,
                                      int item)

  Returns the y-value for one item in a series.

  This method (from the XYDataset interface) is mapped to the getCloseValue(...) method.

  Specified by:
    `getYValue` in interface `XYDataset`
  Parameters:
    `series` - the series (zero-based index).
    `item` - the item (zero-based index).
  Returns:
    the y-value.

### getHighValue

    public java.lang.Number getHighValue(int series,
                                         int item)

  Returns the high-value for one item in a series.

  Specified by:
    `getHighValue` in interface `HighLowDataset`
  Parameters:
    `series` - the series (zero-based index).
    `item` - the item (zero-based index).
  Returns:
    the high-value.

### getHigh

    public double getHigh(int series,
                          int item)

  Returns the high-value (as a double primitive) for an item within a series.

  Specified by:
    `getHigh` in interface `HighLowDataset`
  Parameters:
    `series` - the series (zero-based index).
    `item` - the item (zero-based index).
  Returns:
    The high-value.

### getLowValue

    public java.lang.Number getLowValue(int series,
                                        int item)

  Returns the low-value for one item in a series.

  Specified by:
    `getLowValue` in interface `HighLowDataset`
  Parameters:
    `series` - the series (zero-based index).
    `item` - the item (zero-based index).
  Returns:
    the low-value.

### getLow

    public double getLow(int series,
                         int item)

  Returns the low-value (as a double primitive) for an item within a series.

  Specified by:
    `getLow` in interface `HighLowDataset`
  Parameters:
    `series` - the series (zero-based index).
    `item` - the item (zero-based index).
  Returns:
    The low-value.

### getOpenValue

    public java.lang.Number getOpenValue(int series,
                                         int item)

  Returns the open-value for one item in a series.

  Specified by:
    `getOpenValue` in interface `HighLowDataset`
  Parameters:
    `series` - the series (zero-based index).
    `item` - the item (zero-based index).
  Returns:
    the open-value.

### getOpen

    public double getOpen(int series,
                          int item)

  Returns the open-value (as a double primitive) for an item within a series.

  Specified by:
    `getOpen` in interface `HighLowDataset`
  Parameters:
    `series` - the series (zero-based index).
    `item` - the item (zero-based index).
  Returns:
    The open-value.

### getCloseValue

    public java.lang.Number getCloseValue(int series,
                                          int item)

  Returns the close-value for one item in a series.

  Specified by:
    `getCloseValue` in interface `HighLowDataset`
  Parameters:
    `series` - the series (zero-based index).
    `item` - the item (zero-based index).
  Returns:
    the close-value.

### getClose

    public double getClose(int series,
                           int item)

  Returns the close-value (as a double primitive) for an item within a series.

  Specified by:
    `getClose` in interface `HighLowDataset`
  Parameters:
    `series` - the series (zero-based index).
    `item` - the item (zero-based index).
  Returns:
    The close-value.

### getVolumeValue

    public java.lang.Number getVolumeValue(int series,
                                           int item)

  Returns the volume-value for one item in a series.

  Specified by:
    `getVolumeValue` in interface `HighLowDataset`
  Parameters:
    `series` - the series (zero-based index).
    `item` - the item (zero-based index).
  Returns:
    the volume-value.

### getVolume

    public double getVolume(int series,
                            int item)

  Returns the volume-value (as a double primitive) for an item within a series.

  Specified by:
    `getVolume` in interface `HighLowDataset`
  Parameters:
    `series` - the series (zero-based index).
    `item` - the item (zero-based index).
  Returns:
    The volume-value.

### getSeriesCount

    public int getSeriesCount()

  Returns the number of series in the dataset.

  This implementation only allows one series.

  Specified by:
    `getSeriesCount` in interface `SeriesDataset`
  Specified by:
    `getSeriesCount` in class `AbstractSeriesDataset`
  Returns:
    the number of series.

### getItemCount

    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.

### createNumberArray

    public static java.lang.Number[] createNumberArray(double[] data)

  Constructs an array of Number objects from an array of doubles.

  Parameters:
    `data` - the double values to convert.
  Returns:
    data as array of Number.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD