subseriesdataset.java

来自「JfreeChart 常用图表例子」· Java 代码 · 共 485 行 · 第 1/2 页

JAVA
485
字号
     * @return The volume.     */    public Number getVolume(int series, int item) {        return ((OHLCDataset) this.parent).getVolume(this.map[series], item);    }    /**     * Returns the volume-value (as a double primitive) for an item within a      * series.     *      * @param series  the series (zero-based index).     * @param item  the item (zero-based index).     *      * @return The volume-value.     */    public double getVolumeValue(int series, int item) {        double result = Double.NaN;        Number volume = getVolume(series, item);        if (volume != null) {            result = volume.doubleValue();           }        return result;       }    ///////////////////////////////////////////////////////////////////////////    // From XYDataset    ///////////////////////////////////////////////////////////////////////////    /**     * Returns the X-value for the specified series and item.     * <p>     * Note: throws <code>ClassCastException</code> if the series if 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) {        return ((XYDataset) this.parent).getX(this.map[series], item);    }    /**     * Returns the Y-value for the specified series and item.     * <p>     * Note: throws <code>ClassCastException</code> if the series if 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) {        return ((XYDataset) this.parent).getY(this.map[series], item);    }    /**     * Returns the number of items in a series.     * <p>     * Note: throws <code>ClassCastException</code> if the series if 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) {        return ((XYDataset) this.parent).getItemCount(this.map[series]);    }    ///////////////////////////////////////////////////////////////////////////    // From SeriesDataset    ///////////////////////////////////////////////////////////////////////////    /**     * Returns the number of series in the dataset.     *     * @return The number of series in the dataset.     */    public int getSeriesCount() {        return this.map.length;    }    /**     * Returns the key for a series.     *     * @param series  the series (zero-based index).     *     * @return The name of a series.     */    public Comparable getSeriesKey(int series) {        return this.parent.getSeriesKey(this.map[series]);    }    ///////////////////////////////////////////////////////////////////////////    // From IntervalXYDataset    ///////////////////////////////////////////////////////////////////////////    /**     * 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 starting X value for the specified series and item.     */    public Number getStartX(int series, int item) {        if (this.parent instanceof IntervalXYDataset) {            return ((IntervalXYDataset) this.parent).getStartX(                this.map[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 ending X value for the specified series and item.     */    public Number getEndX(int series, int item) {        if (this.parent instanceof IntervalXYDataset) {            return ((IntervalXYDataset) this.parent).getEndX(                this.map[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) {        if (this.parent instanceof IntervalXYDataset) {            return ((IntervalXYDataset) this.parent).getStartY(                this.map[series], item            );        }        else {            return getY(series, item);        }    }    /**     * 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) {        if (this.parent instanceof IntervalXYDataset) {            return ((IntervalXYDataset) this.parent).getEndY(                this.map[series], item            );        }        else {            return getY(series, item);        }    }    ///////////////////////////////////////////////////////////////////////////    // From SignalsDataset    ///////////////////////////////////////////////////////////////////////////    /**     * Returns the type.     *     * @param series  the series (zero based index).     * @param item  the item (zero based index).     *     * @return The type.     */    public int getType(int series, int item) {        if (this.parent instanceof SignalsDataset) {            return ((SignalsDataset) this.parent).getType(                this.map[series], item            );        }        else {            return getY(series, item).intValue();        }    }    /**     * Returns the level.     *     * @param series  the series (zero based index).     * @param item  the item (zero based index).     *     * @return The level.     */    public double getLevel(int series, int item) {        if (this.parent instanceof SignalsDataset) {            return ((SignalsDataset) this.parent).getLevel(                this.map[series], item            );        }        else {            return getYValue(series, item);        }    }    ///////////////////////////////////////////////////////////////////////////    // New methods from CombinationDataset    ///////////////////////////////////////////////////////////////////////////    /**     * Returns the parent Dataset of this combination.     *     * @return The parent Dataset of this combination.     */    public SeriesDataset getParent() {        return this.parent;    }    /**     * Returns a map or indirect indexing form our series into parent's series.     *     * @return A map or indirect indexing form our series into parent's series.     */    public int[] getMap() {        return (int[]) this.map.clone();    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?