Package org.jfree.data.statistics
Class DefaultBoxAndWhiskerXYDataset
java.lang.Object
org.jfree.data.AbstractDataset
org.jfree.data.AbstractSeriesDataset
org.jfree.data.AbstractXYDataset
org.jfree.data.statistics.DefaultBoxAndWhiskerXYDataset
- All Implemented Interfaces:
ObjectInputValidation,Serializable,Cloneable,EventListener,Dataset,RangeInfo,SeriesChangeListener,SeriesDataset,BoxAndWhiskerXYDataset,XYDataset
public class DefaultBoxAndWhiskerXYDataset extends AbstractXYDataset implements BoxAndWhiskerXYDataset, RangeInfo
A simple implementation of the
BoxAndWhiskerXYDataset.- Author:
- David Browning
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description DefaultBoxAndWhiskerXYDataset(String seriesName)Constructs a new box and whisker dataset. -
Method Summary
Modifier and Type Method Description voidadd(Date date, BoxAndWhiskerItem item)Adds an item to the dataset.doublegetFaroutCoefficient()Returns the value used as the farout coefficient.intgetItemCount(int series)Returns the number of items in the specified series.NumbergetMaximumRangeValue()Returns the maximum value in the dataset's range (or null if all the values in the range are null).NumbergetMaxOutlier(int series, int item)Returns the maximum value which is not a farout, ie Q3 + (interquartile range * farout coefficient).NumbergetMaxRegularValue(int series, int item)Returns the max-value for the specified series and item.NumbergetMeanValue(int series, int item)Returns the mean for the specified series and item.NumbergetMedianValue(int series, int item)Returns the median-value for the specified series and item.NumbergetMinimumRangeValue()Returns the minimum value in the dataset's range (or null if all the values in the range are null).NumbergetMinOutlier(int series, int item)Returns the minimum value which is not a farout.NumbergetMinRegularValue(int series, int item)Returns the min-value for the specified series and item.doublegetOutlierCoefficient()Returns the value used as the outlier coefficient.ListgetOutliers(int series, int item)Returns an array of outliers for the specified series and item.NumbergetQ1Value(int series, int item)Returns the Q1 median-value for the specified series and item.NumbergetQ3Value(int series, int item)Returns the Q3 median-value for the specified series and item.intgetSeriesCount()Returns the number of series in the dataset.StringgetSeriesName(int i)Returns the name of the series stored in this dataset.RangegetValueRange()Returns the range of the values in this dataset's range.DategetXDate(int series, int item)Returns the x-value for one item in a series, as a Date.NumbergetXValue(int series, int item)Returns the x-value for one item in a series.NumbergetYValue(int series, int item)Returns the y-value for one item in a series.voidsetFaroutCoefficient(double faroutCoefficient)Sets the value used as the farouts coefficient.voidsetOutlierCoefficient(double outlierCoefficient)Sets the value used as the outlier coefficientMethods inherited from class org.jfree.data.AbstractXYDataset
getX, getYMethods inherited from class org.jfree.data.AbstractSeriesDataset
seriesChangedMethods inherited from class org.jfree.data.AbstractDataset
addChangeListener, clone, getGroup, removeChangeListener, setGroup, validateObjectMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jfree.data.Dataset
addChangeListener, getGroup, removeChangeListener, setGroup
-
Constructor Details
-
DefaultBoxAndWhiskerXYDataset
Constructs a new box and whisker dataset.The current implementation allows only one series in the dataset. This may be extended in a future version.
- Parameters:
seriesName- the name of the series.
-
-
Method Details
-
add
Adds an item to the dataset.- Parameters:
date- the date.item- the item.
-
getSeriesName
Returns the name of the series stored in this dataset.- Specified by:
getSeriesNamein interfaceSeriesDataset- Specified by:
getSeriesNamein classAbstractSeriesDataset- Parameters:
i- the index of the series. Currently ignored.- Returns:
- the name of this series.
-
getXValue
Returns the x-value for one item in a series.The value returned is a Long object generated from the underlying Date object.
-
getXDate
Returns the x-value for one item in a series, as a Date.This method is provided for convenience only.
- Parameters:
series- the series (zero-based index).item- the item (zero-based index).- Returns:
- the x-value as a Date.
-
getYValue
Returns the y-value for one item in a series.This method (from the XYDataset interface) is mapped to the getMaxNonOutlierValue(...) method.
-
getMeanValue
Returns the mean for the specified series and item.- Specified by:
getMeanValuein interfaceBoxAndWhiskerXYDataset- Parameters:
series- the series (zero-based index).item- the item (zero-based index).- Returns:
- the mean for the specified series and item.
-
getMedianValue
Returns the median-value for the specified series and item.- Specified by:
getMedianValuein interfaceBoxAndWhiskerXYDataset- Parameters:
series- the series (zero-based index).item- the item (zero-based index).- Returns:
- the median-value for the specified series and item.
-
getQ1Value
Returns the Q1 median-value for the specified series and item.- Specified by:
getQ1Valuein interfaceBoxAndWhiskerXYDataset- Parameters:
series- the series (zero-based index).item- the item (zero-based index).- Returns:
- the Q1 median-value for the specified series and item.
-
getQ3Value
Returns the Q3 median-value for the specified series and item.- Specified by:
getQ3Valuein interfaceBoxAndWhiskerXYDataset- Parameters:
series- the series (zero-based index).item- the item (zero-based index).- Returns:
- the Q3 median-value for the specified series and item.
-
getMinRegularValue
Returns the min-value for the specified series and item.- Specified by:
getMinRegularValuein interfaceBoxAndWhiskerXYDataset- Parameters:
series- the series (zero-based index).item- the item (zero-based index).- Returns:
- the min-value for the specified series and item.
-
getMaxRegularValue
Returns the max-value for the specified series and item.- Specified by:
getMaxRegularValuein interfaceBoxAndWhiskerXYDataset- Parameters:
series- the series (zero-based index).item- the item (zero-based index).- Returns:
- the max-value for the specified series and item.
-
getMinOutlier
Returns the minimum value which is not a farout.- Specified by:
getMinOutlierin interfaceBoxAndWhiskerXYDataset- Parameters:
series- the series (zero-based index).item- the item (zero-based index).- Returns:
- a
Numberrepresenting the maximum non-farout value.
-
getMaxOutlier
Returns the maximum value which is not a farout, ie Q3 + (interquartile range * farout coefficient).- Specified by:
getMaxOutlierin interfaceBoxAndWhiskerXYDataset- Parameters:
series- the series (zero-based index).item- the item (zero-based index).- Returns:
- a
Numberrepresenting the maximum non-farout value.
-
getOutliers
Returns an array of outliers for the specified series and item.- Specified by:
getOutliersin interfaceBoxAndWhiskerXYDataset- Parameters:
series- the series (zero-based index).item- the item (zero-based index).- Returns:
- the array of outliers for the specified series and item.
-
getOutlierCoefficient
public double getOutlierCoefficient()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- Specified by:
getOutlierCoefficientin interfaceBoxAndWhiskerXYDataset- Returns:
- a
doublerepresenting the value used to calculate outliers
-
getFaroutCoefficient
public double getFaroutCoefficient()Returns the value used as the farout coefficient. The farout coefficient allows the calculation of which values will be off the graph.- Specified by:
getFaroutCoefficientin interfaceBoxAndWhiskerXYDataset- Returns:
- a
doublerepresenting the value used to calculate farouts
-
getSeriesCount
public int getSeriesCount()Returns the number of series in the dataset.This implementation only allows one series.
- Specified by:
getSeriesCountin interfaceSeriesDataset- Specified by:
getSeriesCountin classAbstractSeriesDataset- Returns:
- the number of series.
-
getItemCount
public int getItemCount(int series)Returns the number of items in the specified series.- Specified by:
getItemCountin interfaceXYDataset- Parameters:
series- the index (zero-based) of the series.- Returns:
- the number of items in the specified series.
-
setOutlierCoefficient
public void setOutlierCoefficient(double outlierCoefficient)Sets the value used as the outlier coefficient- Parameters:
outlierCoefficient- being adoublerepresenting the value used to calculate outliers
-
setFaroutCoefficient
public void setFaroutCoefficient(double faroutCoefficient)Sets the value used as the farouts coefficient. The farout coefficient must b greater than the outlier coefficient.- Parameters:
faroutCoefficient- being adoublerepresenting the value used to calculate farouts
-
getMinimumRangeValue
Returns the minimum value in the dataset's range (or null if all the values in the range are null).- Specified by:
getMinimumRangeValuein interfaceRangeInfo- Returns:
- the minimum value.
-
getMaximumRangeValue
Returns the maximum value in the dataset's range (or null if all the values in the range are null).- Specified by:
getMaximumRangeValuein interfaceRangeInfo- Returns:
- the maximum value.
-
getValueRange
Returns the range of the values in this dataset's range.- Specified by:
getValueRangein interfaceRangeInfo- Returns:
- the range.
-