/** * Returns the key for a series. * * @param series the series (zero-based index). * * @return The key for a series. */ public Comparable getSeriesKey(int series) { DatasetInfo di = getDatasetInfo(series); return di.data.getSeriesKey(di.series); }
/** * Returns the Y-value for the specified series and item. * <P> * Note: throws <code>ClassCastException</code> if the series is not from * a {@link XYDataset}. * * @param series the index of the series of interest (zero-based). * @param item the index of the item of interest (zero-based). * * @return The Y-value for the specified series and item. */ public Number getY(int series, int item) { DatasetInfo di = getDatasetInfo(series); return ((XYDataset) di.data).getY(di.series, item); }
/** * Returns the number of items in a series. * <P> * Note: throws <code>ClassCastException</code> if the series is not from * a {@link XYDataset}. * * @param series the index of the series of interest (zero-based). * * @return The number of items in a series. */ public int getItemCount(int series) { DatasetInfo di = getDatasetInfo(series); return ((XYDataset) di.data).getItemCount(di.series); }
/** * Returns the X-value for the specified series and item. * <P> * Note: throws <code>ClassCastException</code> if the series is not from * a {@link XYDataset}. * * @param series the index of the series of interest (zero-based). * @param item the index of the item of interest (zero-based). * * @return The X-value for the specified series and item. */ public Number getX(int series, int item) { DatasetInfo di = getDatasetInfo(series); return ((XYDataset) di.data).getX(di.series, item); }
/** * Returns the close-value for the specified series and item. * <P> * Note: throws <code>ClassCastException</code> if the series is not from a * {@link OHLCDataset}. * * @param series the index of the series of interest (zero-based). * @param item the index of the item of interest (zero-based). * * @return The close-value for the specified series and item. */ public Number getClose(int series, int item) { DatasetInfo di = getDatasetInfo(series); return ((OHLCDataset) di.data).getClose(di.series, item); }
/** * Returns the volume value for the specified series and item. * <P> * Note: throws <code>ClassCastException</code> if the series is not from a * {@link OHLCDataset}. * * @param series the index of the series of interest (zero-based). * @param item the index of the item of interest (zero-based). * * @return The volume value for the specified series and item. */ public Number getVolume(int series, int item) { DatasetInfo di = getDatasetInfo(series); return ((OHLCDataset) di.data).getVolume(di.series, item); }
/** * Returns the high-value for the specified series and item. * <P> * Note: throws <code>ClassCastException</code> if the series is not from a * {@link OHLCDataset}. * * @param series the index of the series of interest (zero-based). * @param item the index of the item of interest (zero-based). * * @return The high-value for the specified series and item. */ public Number getHigh(int series, int item) { DatasetInfo di = getDatasetInfo(series); return ((OHLCDataset) di.data).getHigh(di.series, item); }
/** * Returns the low-value for the specified series and item. * <P> * Note: throws <code>ClassCastException</code> if the series is not from a * {@link OHLCDataset}. * * @param series the index of the series of interest (zero-based). * @param item the index of the item of interest (zero-based). * * @return The low-value for the specified series and item. */ public Number getLow(int series, int item) { DatasetInfo di = getDatasetInfo(series); return ((OHLCDataset) di.data).getLow(di.series, item); }
/** * Returns the open-value for the specified series and item. * <P> * Note: throws <code>ClassCastException</code> if the series is not from a * {@link OHLCDataset}. * * @param series the index of the series of interest (zero-based). * @param item the index of the item of interest (zero-based). * * @return The open-value for the specified series and item. */ public Number getOpen(int series, int item) { DatasetInfo di = getDatasetInfo(series); return ((OHLCDataset) di.data).getOpen(di.series, item); }
/** * Returns the parent Dataset of this combination. If there is more than * one parent, or a child is found that is not a CombinationDataset, then * returns <code>null</code>. * * @return The parent Dataset of this combination or <code>null</code>. */ public SeriesDataset getParent() { SeriesDataset parent = null; for (int i = 0; i < this.datasetInfo.size(); i++) { SeriesDataset child = getDatasetInfo(i).data; if (child instanceof CombinationDataset) { SeriesDataset childParent = ((CombinationDataset) child).getParent(); if (parent == null) { parent = childParent; } else if (parent != childParent) { return null; } } else { return null; } } return parent; }
/** * Returns the child position. * * @param child the child dataset. * * @return The position. */ public int getChildPosition(Dataset child) { int n = 0; for (int i = 0; i < this.datasetInfo.size(); i++) { SeriesDataset childDataset = getDatasetInfo(i).data; if (childDataset instanceof CombinedDataset) { int m = ((CombinedDataset) childDataset) .getChildPosition(child); if (m >= 0) { return n + m; } n++; } else { if (child == childDataset) { return n; } n++; } } return -1; }
/** * Returns the ending Y value for the specified series and item. * * @param series the index of the series of interest (zero-based). * @param item the index of the item of interest (zero-based). * * @return The ending Y value for the specified series and item. */ public Number getEndY(int series, int item) { DatasetInfo di = getDatasetInfo(series); if (di.data instanceof IntervalXYDataset) { return ((IntervalXYDataset) di.data).getEndY(di.series, item); } else { return getY(series, item); } }
/** * Returns the starting X value for the specified series and item. * * @param series the index of the series of interest (zero-based). * @param item the index of the item of interest (zero-based). * * @return The value. */ public Number getStartX(int series, int item) { DatasetInfo di = getDatasetInfo(series); if (di.data instanceof IntervalXYDataset) { return ((IntervalXYDataset) di.data).getStartX(di.series, item); } else { return getX(series, item); } }
/** * Returns the ending X value for the specified series and item. * * @param series the index of the series of interest (zero-based). * @param item the index of the item of interest (zero-based). * * @return The value. */ public Number getEndX(int series, int item) { DatasetInfo di = getDatasetInfo(series); if (di.data instanceof IntervalXYDataset) { return ((IntervalXYDataset) di.data).getEndX(di.series, item); } else { return getX(series, item); } }
/** * Returns the starting Y value for the specified series and item. * * @param series the index of the series of interest (zero-based). * @param item the index of the item of interest (zero-based). * * @return The starting Y value for the specified series and item. */ public Number getStartY(int series, int item) { DatasetInfo di = getDatasetInfo(series); if (di.data instanceof IntervalXYDataset) { return ((IntervalXYDataset) di.data).getStartY(di.series, item); } else { return getY(series, item); } }
/** * Returns a map or indirect indexing form our series into parent's series. * Prior to calling this method, the client should check getParent() to make * sure the CombinationDataset uses the same parent. If not, the map * returned by this method will be invalid or null. * * @return A map or indirect indexing form our series into parent's series. * * @see #getParent() */ public int[] getMap() { int[] map = null; for (int i = 0; i < this.datasetInfo.size(); i++) { SeriesDataset child = getDatasetInfo(i).data; if (child instanceof CombinationDataset) { int[] childMap = ((CombinationDataset) child).getMap(); if (childMap == null) { return null; } map = joinMap(map, childMap); } else { return null; } } return map; }