1. /* ===========================================================
  2. * JFreeChart : a free chart library for the Java(tm) platform
  3. * ===========================================================
  4. *
  5. * (C) Copyright 2000-2005, by Object Refinery Limited and Contributors.
  6. *
  7. * Project Info: http://www.jfree.org/jfreechart/index.html
  8. *
  9. * This library is free software; you can redistribute it and/or modify it
  10. * under the terms of the GNU Lesser General Public License as published by
  11. * the Free Software Foundation; either version 2.1 of the License, or
  12. * (at your option) any later version.
  13. *
  14. * This library is distributed in the hope that it will be useful, but
  15. * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  16. * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
  17. * License for more details.
  18. *
  19. * You should have received a copy of the GNU Lesser General Public License
  20. * along with this library; if not, write to the Free Software Foundation,
  21. * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
  22. *
  23. * [Java is a trademark or registered trademark of Sun Microsystems, Inc.
  24. * in the United States and other countries.]
  25. *
  26. * ---------------------------
  27. * BoxAndWhiskerXYDataset.java
  28. * ---------------------------
  29. * (C) Copyright 2003, by David Browning and Contributors.
  30. *
  31. * Original Author: David Browning (for Australian Institute of Marine
  32. * Science);
  33. * Contributor(s): David Gilbert (for Object Refinery Limited);
  34. *
  35. * $Id: BoxAndWhiskerXYDataset.java,v 1.2 2005/02/09 13:56:14 mungady Exp $
  36. *
  37. * Changes
  38. * -------
  39. * 05-Aug-2003 : Version 1, contributed by David Browning (DG);
  40. * 12-Aug-2003 : Added new methods: getMaxNonOutlierValue
  41. * getMaxNonFaroutValue
  42. * getOutlierCoefficient
  43. * setOutlierCoefficient
  44. * getFaroutCoefficient
  45. * setFaroutCoefficient
  46. * getInterquartileRange (DB)
  47. * 27-Aug-2003 : Renamed BoxAndWhiskerDataset --> BoxAndWhiskerXYDataset, and
  48. * cut down methods (DG);
  49. *
  50. */
  51. package org.jfree.data.statistics;
  52. import java.util.List;
  53. import org.jfree.data.xy.XYDataset;
  54. /**
  55. * An interface that defines data in the form of (x, max, min, average, median)
  56. * tuples.
  57. * <P>
  58. * Example: JFreeChart uses this interface to obtain data for AIMS
  59. * max-min-average-median plots.
  60. *
  61. * @author David Browning
  62. */
  63. public interface BoxAndWhiskerXYDataset extends XYDataset {
  64. /**
  65. * Returns the mean for the specified series and item.
  66. *
  67. * @param series the series (zero-based index).
  68. * @param item the item (zero-based index).
  69. *
  70. * @return the mean for the specified series and item.
  71. */
  72. public Number getMeanValue(int series, int item);
  73. /**
  74. * Returns the median-value for the specified series and item.
  75. *
  76. * @param series the series (zero-based index).
  77. * @param item the item (zero-based index).
  78. *
  79. * @return the median-value for the specified series and item.
  80. */
  81. public Number getMedianValue(int series, int item);
  82. /**
  83. * Returns the Q1 median-value for the specified series and item.
  84. *
  85. * @param series the series (zero-based index).
  86. * @param item the item (zero-based index).
  87. *
  88. * @return the Q1 median-value for the specified series and item.
  89. */
  90. public Number getQ1Value(int series, int item);
  91. /**
  92. * Returns the Q3 median-value for the specified series and item.
  93. *
  94. * @param series the series (zero-based index).
  95. * @param item the item (zero-based index).
  96. *
  97. * @return the Q3 median-value for the specified series and item.
  98. */
  99. public Number getQ3Value(int series, int item);
  100. /**
  101. * Returns the min-value for the specified series and item.
  102. *
  103. * @param series the series (zero-based index).
  104. * @param item the item (zero-based index).
  105. *
  106. * @return the min-value for the specified series and item.
  107. */
  108. public Number getMinRegularValue(int series, int item);
  109. /**
  110. * Returns the max-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 max-value for the specified series and item.
  116. */
  117. public Number getMaxRegularValue(int series, int item);
  118. /**
  119. * Returns the minimum value which is not a farout.
  120. * @param series the series (zero-based index).
  121. * @param item the item (zero-based index).
  122. *
  123. * @return a <code>Number</code> representing the maximum non-farout value.
  124. */
  125. public Number getMinOutlier(int series, int item);
  126. /**
  127. * Returns the maximum value which is not a farout, ie Q3 + (interquartile
  128. * range * farout coefficient).
  129. *
  130. * @param series the series (zero-based index).
  131. * @param item the item (zero-based index).
  132. *
  133. * @return a <code>Number</code> representing the maximum non-farout value.
  134. */
  135. public Number getMaxOutlier(int series, int item);
  136. /**
  137. * Returns an array of outliers for the specified series and item.
  138. *
  139. * @param series the series (zero-based index).
  140. * @param item the item (zero-based index).
  141. *
  142. * @return the array of outliers for the specified series and item.
  143. */
  144. public List getOutliers(int series, int item);
  145. /**
  146. * Returns the value used as the outlier coefficient. The outlier
  147. * coefficient gives an indication of the degree of certainty in an
  148. * unskewed distribution. Increasing the coefficient increases the number
  149. * of values included. Currently only used to ensure farout coefficient
  150. * is greater than the outlier coefficient
  151. *
  152. * @return A <code>double</code> representing the value used to calculate
  153. * outliers
  154. */
  155. public double getOutlierCoefficient();
  156. /**
  157. * Returns the value used as the farout coefficient. The farout coefficient
  158. * allows the calculation of which values will be off the graph.
  159. *
  160. * @return A <code>double</code> representing the value used to calculate
  161. * farouts
  162. */
  163. public double getFaroutCoefficient();
  164. }