Package org.jfree.data.statistics
Class DefaultBoxAndWhiskerXYDataset
java.lang.Object
org.jfree.data.general.AbstractDataset
org.jfree.data.general.AbstractSeriesDataset
org.jfree.data.xy.AbstractXYDataset
org.jfree.data.statistics.DefaultBoxAndWhiskerXYDataset
- All Implemented Interfaces:
ObjectInputValidation,Serializable,Cloneable,EventListener,Dataset,SeriesChangeListener,SeriesDataset,RangeInfo,BoxAndWhiskerXYDataset,XYDataset
public class DefaultBoxAndWhiskerXYDataset
extends AbstractXYDataset
implements BoxAndWhiskerXYDataset, RangeInfo
A simple implementation of the
BoxAndWhiskerXYDataset interface.
This dataset implementation can hold only one series.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultBoxAndWhiskerXYDataset(Comparable seriesKey) Constructs a new box and whisker dataset. -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(Date date, BoxAndWhiskerItem item) Adds an item to the dataset and sends aDatasetChangeEventto all registered listeners.clone()Returns a clone of the plot.booleanTests this dataset for equality with an arbitrary object.doubleReturns the value used as the farout coefficient.getItem(int series, int item) Return an item from within the dataset.intgetItemCount(int series) Returns the number of items in the specified series.getMaxOutlier(int series, int item) Returns the maximum value which is not a farout, ie Q3 + (interquartile range * farout coefficient).getMaxRegularValue(int series, int item) Returns the max-value for the specified series and item.getMeanValue(int series, int item) Returns the mean for the specified series and item.getMedianValue(int series, int item) Returns the median-value for the specified series and item.getMinOutlier(int series, int item) Returns the minimum value which is not a farout.getMinRegularValue(int series, int item) Returns the min-value for the specified series and item.doubleReturns the value used as the outlier coefficient.getOutliers(int series, int item) Returns a list of outliers for the specified series and item.getQ1Value(int series, int item) Returns the Q1 median-value for the specified series and item.getQ3Value(int series, int item) Returns the Q3 median-value for the specified series and item.getRangeBounds(boolean includeInterval) Returns the range of the values in this dataset's range.doublegetRangeLowerBound(boolean includeInterval) Returns the minimum y-value in the dataset.doublegetRangeUpperBound(boolean includeInterval) Returns the maximum y-value in the dataset.intReturns the number of series in the dataset.getSeriesKey(int i) Returns the name of the series stored in this dataset.getX(int series, int item) Returns the x-value for one item in a series.getXDate(int series, int item) Returns the x-value for one item in a series, as a Date.getY(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.xy.AbstractXYDataset
getDomainOrder, getXValue, getYValueMethods inherited from class org.jfree.data.general.AbstractSeriesDataset
indexOf, seriesChangedMethods inherited from class org.jfree.data.general.AbstractDataset
addChangeListener, canEqual, fireDatasetChanged, getGroup, getNotify, hashCode, hasListener, notifyListeners, removeChangeListener, setGroup, setNotify, validateObjectMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jfree.data.general.Dataset
addChangeListener, getGroup, removeChangeListener, setGroupMethods inherited from interface org.jfree.data.general.SeriesDataset
indexOfMethods inherited from interface org.jfree.data.xy.XYDataset
getDomainOrder, getXValue, getYValue
-
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:
seriesKey- the key for the series.
-
-
Method Details
-
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. - See Also:
-
setOutlierCoefficient
Sets the value used as the outlier coefficient- Parameters:
outlierCoefficient- being adoublerepresenting the value used to calculate outliers.- See Also:
-
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. - See Also:
-
setFaroutCoefficient
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.- See Also:
-
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
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.
-
add
Adds an item to the dataset and sends aDatasetChangeEventto all registered listeners.- Parameters:
date- the date (nullnot permitted).item- the item (nullnot permitted).
-
getSeriesKey
Returns the name of the series stored in this dataset.- Specified by:
getSeriesKeyin interfaceSeriesDataset- Specified by:
getSeriesKeyin classAbstractSeriesDataset- Parameters:
i- the index of the series. Currently ignored.- Returns:
- The name of this series.
-
getItem
Return an item from within the dataset.- Parameters:
series- the series index (ignored, since this dataset contains only one series).item- the item within the series (zero-based index)- Returns:
- The item.
-
getX
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.
-
getY
Returns the y-value for one item in a series.This method (from the XYDataset interface) is mapped to the getMeanValue() 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 a list 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 list of outliers for the specified series and item
(possibly
null).
-
getRangeLowerBound
Returns the minimum y-value in the dataset.- Specified by:
getRangeLowerBoundin interfaceRangeInfo- Parameters:
includeInterval- a flag that determines whether or not the y-interval is taken into account.- Returns:
- The minimum value.
-
getRangeUpperBound
Returns the maximum y-value in the dataset.- Specified by:
getRangeUpperBoundin interfaceRangeInfo- Parameters:
includeInterval- a flag that determines whether or not the y-interval is taken into account.- Returns:
- The maximum value.
-
getRangeBounds
Returns the range of the values in this dataset's range.- Specified by:
getRangeBoundsin interfaceRangeInfo- Parameters:
includeInterval- a flag that determines whether or not the y-interval is taken into account.- Returns:
- The range.
-
equals
Tests this dataset for equality with an arbitrary object.- Overrides:
equalsin classAbstractDataset- Parameters:
obj- the object (nullpermitted).- Returns:
- A boolean.
-
clone
Returns a clone of the plot.- Overrides:
clonein classAbstractDataset- Returns:
- A clone.
- Throws:
CloneNotSupportedException- if the cloning is not supported.
-