001/* =========================================================== 002 * JFreeChart : a free chart library for the Java(tm) platform 003 * =========================================================== 004 * 005 * (C) Copyright 2000-2022, by David Gilbert and Contributors. 006 * 007 * Project Info: http://www.jfree.org/jfreechart/index.html 008 * 009 * This library is free software; you can redistribute it and/or modify it 010 * under the terms of the GNU Lesser General Public License as published by 011 * the Free Software Foundation; either version 2.1 of the License, or 012 * (at your option) any later version. 013 * 014 * This library is distributed in the hope that it will be useful, but 015 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 016 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 017 * License for more details. 018 * 019 * You should have received a copy of the GNU Lesser General Public 020 * License along with this library; if not, write to the Free Software 021 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 022 * USA. 023 * 024 * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 025 * Other names may be trademarks of their respective owners.] 026 * 027 * --------------------------- 028 * BoxAndWhiskerXYDataset.java 029 * --------------------------- 030 * (C) Copyright 2003-2008, by David Browning and Contributors. 031 * 032 * Original Author: David Browning (for Australian Institute of Marine 033 * Science); 034 * Contributor(s): David Gilbert; 035 * 036 * Changes 037 * ------- 038 * 05-Aug-2003 : Version 1, contributed by David Browning (DG); 039 * 12-Aug-2003 : Added new methods: getMaxNonOutlierValue 040 * getMaxNonFaroutValue 041 * getOutlierCoefficient 042 * setOutlierCoefficient 043 * getFaroutCoefficient 044 * setFaroutCoefficient 045 * getInterquartileRange (DB) 046 * 27-Aug-2003 : Renamed BoxAndWhiskerDataset --> BoxAndWhiskerXYDataset, and 047 * cut down methods (DG); 048 * ------------- JFREECHART 1.0.x --------------------------------------------- 049 * 02-Feb-2007 : Removed author tags from all over JFreeChart sources (DG); 050 * 051 */ 052 053package org.jfree.data.statistics; 054 055import java.util.List; 056 057import org.jfree.data.xy.XYDataset; 058 059/** 060 * An interface that defines data in the form of (x, max, min, average, median) 061 * tuples. 062 * <P> 063 * Example: JFreeChart uses this interface to obtain data for AIMS 064 * max-min-average-median plots. 065 */ 066public interface BoxAndWhiskerXYDataset<S extends Comparable<S>> 067 extends XYDataset<S> { 068 069 /** 070 * Returns the mean for the specified series and item. 071 * 072 * @param series the series (zero-based index). 073 * @param item the item (zero-based index). 074 * 075 * @return The mean for the specified series and item. 076 */ 077 Number getMeanValue(int series, int item); 078 079 /** 080 * Returns the median-value for the specified series and item. 081 * 082 * @param series the series (zero-based index). 083 * @param item the item (zero-based index). 084 * 085 * @return The median-value for the specified series and item. 086 */ 087 Number getMedianValue(int series, int item); 088 089 /** 090 * Returns the Q1 median-value for the specified series and item. 091 * 092 * @param series the series (zero-based index). 093 * @param item the item (zero-based index). 094 * 095 * @return The Q1 median-value for the specified series and item. 096 */ 097 Number getQ1Value(int series, int item); 098 099 /** 100 * Returns the Q3 median-value for the specified series and item. 101 * 102 * @param series the series (zero-based index). 103 * @param item the item (zero-based index). 104 * 105 * @return The Q3 median-value for the specified series and item. 106 */ 107 Number getQ3Value(int series, int item); 108 109 /** 110 * Returns the min-value for the specified series and item. 111 * 112 * @param series the series (zero-based index). 113 * @param item the item (zero-based index). 114 * 115 * @return The min-value for the specified series and item. 116 */ 117 Number getMinRegularValue(int series, int item); 118 119 /** 120 * Returns the max-value for the specified series and item. 121 * 122 * @param series the series (zero-based index). 123 * @param item the item (zero-based index). 124 * 125 * @return The max-value for the specified series and item. 126 */ 127 Number getMaxRegularValue(int series, int item); 128 129 /** 130 * Returns the minimum value which is not a farout. 131 * @param series the series (zero-based index). 132 * @param item the item (zero-based index). 133 * 134 * @return A {@code Number} representing the maximum non-farout value. 135 */ 136 Number getMinOutlier(int series, int item); 137 138 /** 139 * Returns the maximum value which is not a farout, ie Q3 + (interquartile 140 * range * farout coefficient). 141 * 142 * @param series the series (zero-based index). 143 * @param item the item (zero-based index). 144 * 145 * @return A {@code Number} representing the maximum non-farout value. 146 */ 147 Number getMaxOutlier(int series, int item); 148 149 /** 150 * Returns a list of outliers for the specified series and item. 151 * 152 * @param series the series (zero-based index). 153 * @param item the item (zero-based index). 154 * 155 * @return The list of outliers for the specified series and item 156 * (possibly {@code null}). 157 */ 158 List getOutliers(int series, int item); 159 160 /** 161 * Returns the value used as the outlier coefficient. The outlier 162 * coefficient gives an indication of the degree of certainty in an 163 * unskewed distribution. Increasing the coefficient increases the number 164 * of values included. Currently only used to ensure farout coefficient 165 * is greater than the outlier coefficient 166 * 167 * @return A {@code double} representing the value used to calculate 168 * outliers 169 */ 170 double getOutlierCoefficient(); 171 172 /** 173 * Returns the value used as the farout coefficient. The farout coefficient 174 * allows the calculation of which values will be off the graph. 175 * 176 * @return A {@code double} representing the value used to calculate 177 * farouts 178 */ 179 double getFaroutCoefficient(); 180 181}