## org.jfree.data.xy
Class DefaultHighLowDataset

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

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

    public class DefaultHighLowDataset

extends AbstractXYDataset
implements OHLCDataset

A simple implementation of the `OHLCDataset`.

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.
`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.String` `getSeriesName(int i)` Returns the name of 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.

Methods inherited from class org.jfree.data.xy.AbstractXYDataset
`getDomainOrder, getXValue, getYValue`

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

Methods inherited from class org.jfree.data.general.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.xy.XYDataset
`getDomainOrder, getXValue, getYValue`

Methods inherited from interface org.jfree.data.general.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.

### getX

    public java.lang.Number getX(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:
    `getX` 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.

### getY

    public java.lang.Number getY(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(int, int)` method.

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

### getHigh

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

### getHighValue

    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.

### getLow

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

### getLowValue

    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.

### getOpen

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

### getOpenValue

    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.

### getClose

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

### getCloseValue

    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.

### getVolume

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

### getVolumeValue

    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.

### 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:
    The data as an array of Number objects.