defaultboxandwhiskerxydataset.java
来自「JfreeChart 常用图表例子」· Java 代码 · 共 505 行 · 第 1/2 页
JAVA
505 行
* @return The median-value for the specified series and item. */ public Number getMedianValue(int series, int item) { Number result = null; BoxAndWhiskerItem stats = (BoxAndWhiskerItem) this.items.get(item); if (stats != null) { result = stats.getMedian(); } return result; } /** * Returns the Q1 median-value for the specified series and item. * * @param series the series (zero-based index). * @param item the item (zero-based index). * * @return The Q1 median-value for the specified series and item. */ public Number getQ1Value(int series, int item) { Number result = null; BoxAndWhiskerItem stats = (BoxAndWhiskerItem) this.items.get(item); if (stats != null) { result = stats.getQ1(); } return result; } /** * Returns the Q3 median-value for the specified series and item. * * @param series the series (zero-based index). * @param item the item (zero-based index). * * @return The Q3 median-value for the specified series and item. */ public Number getQ3Value(int series, int item) { Number result = null; BoxAndWhiskerItem stats = (BoxAndWhiskerItem) this.items.get(item); if (stats != null) { result = stats.getQ3(); } return result; } /** * Returns the min-value for the specified series and item. * * @param series the series (zero-based index). * @param item the item (zero-based index). * * @return The min-value for the specified series and item. */ public Number getMinRegularValue(int series, int item) { Number result = null; BoxAndWhiskerItem stats = (BoxAndWhiskerItem) this.items.get(item); if (stats != null) { result = stats.getMinRegularValue(); } return result; } /** * Returns the max-value for the specified series and item. * * @param series the series (zero-based index). * @param item the item (zero-based index). * * @return The max-value for the specified series and item. */ public Number getMaxRegularValue(int series, int item) { Number result = null; BoxAndWhiskerItem stats = (BoxAndWhiskerItem) this.items.get(item); if (stats != null) { result = stats.getMaxRegularValue(); } return result; } /** * Returns the minimum value which is not a farout. * @param series the series (zero-based index). * @param item the item (zero-based index). * * @return A <code>Number</code> representing the maximum non-farout value. */ public Number getMinOutlier(int series, int item) { Number result = null; BoxAndWhiskerItem stats = (BoxAndWhiskerItem) this.items.get(item); if (stats != null) { result = stats.getMinOutlier(); } return result; } /** * Returns the maximum value which is not a farout, ie Q3 + (interquartile * range * farout coefficient). * * @param series the series (zero-based index). * @param item the item (zero-based index). * * @return A <code>Number</code> representing the maximum non-farout value. */ public Number getMaxOutlier(int series, int item) { Number result = null; BoxAndWhiskerItem stats = (BoxAndWhiskerItem) this.items.get(item); if (stats != null) { result = stats.getMaxOutlier(); } return result; } /** * Returns an array of outliers for the specified series and item. * * @param series the series (zero-based index). * @param item the item (zero-based index). * * @return The array of outliers for the specified series and item. */ public List getOutliers(int series, int item) { List result = null; BoxAndWhiskerItem stats = (BoxAndWhiskerItem) this.items.get(item); if (stats != null) { result = stats.getOutliers(); } return result; } /** * Returns the value used as the outlier coefficient. The outlier * coefficient gives an indication of the degree of certainty in an * unskewed distribution. Increasing the coefficient increases the number * of values included. Currently only used to ensure farout coefficient is * greater than the outlier coefficient * * @return A <code>double</code> representing the value used to calculate * outliers. */ public double getOutlierCoefficient() { return this.outlierCoefficient; } /** * Returns the value used as the farout coefficient. The farout coefficient * allows the calculation of which values will be off the graph. * * @return A <code>double</code> representing the value used to calculate * farouts. */ public double getFaroutCoefficient() { return this.faroutCoefficient; } /** * Returns the number of series in the dataset. * <p> * This implementation only allows one series. * * @return The number of series. */ public int getSeriesCount() { return 1; } /** * Returns the number of items in the specified series. * * @param series the index (zero-based) of the series. * * @return The number of items in the specified series. */ public int getItemCount(int series) { return this.dates.size(); } /** * Sets the value used as the outlier coefficient * * @param outlierCoefficient being a <code>double</code> representing the * value used to calculate outliers. */ public void setOutlierCoefficient(double outlierCoefficient) { this.outlierCoefficient = outlierCoefficient; } /** * Sets the value used as the farouts coefficient. The farout coefficient * must b greater than the outlier coefficient. * * @param faroutCoefficient being a <code>double</code> representing the * value used to calculate farouts. */ public void setFaroutCoefficient(double faroutCoefficient) { if (faroutCoefficient > getOutlierCoefficient()) { this.faroutCoefficient = faroutCoefficient; } else { throw new IllegalArgumentException("Farout value must be greater " + "than the outlier value, which is currently set at: (" + getOutlierCoefficient() + ")"); } } /** * Returns the minimum y-value in the dataset. * * @param includeInterval a flag that determines whether or not the * y-interval is taken into account. * * @return The minimum value. */ public double getRangeLowerBound(boolean includeInterval) { double result = Double.NaN; if (this.minimumRangeValue != null) { result = this.minimumRangeValue.doubleValue(); } return result; } /** * Returns the maximum y-value in the dataset. * * @param includeInterval a flag that determines whether or not the * y-interval is taken into account. * * @return The maximum value. */ public double getRangeUpperBound(boolean includeInterval) { double result = Double.NaN; if (this.maximumRangeValue != null) { result = this.maximumRangeValue.doubleValue(); } return result; } /** * Returns the range of the values in this dataset's range. * * @param includeInterval a flag that determines whether or not the * y-interval is taken into account. * * @return The range. */ public Range getRangeBounds(boolean includeInterval) { return this.rangeBounds; }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?