org.jfree.data.statistics
Class DefaultBoxAndWhiskerCategoryDataset

java.lang.Object
  extended byorg.jfree.data.general.AbstractDataset
      extended byorg.jfree.data.statistics.DefaultBoxAndWhiskerCategoryDataset
All Implemented Interfaces:
BoxAndWhiskerCategoryDataset, CategoryDataset, java.lang.Cloneable, Dataset, KeyedValues2D, java.io.ObjectInputValidation, RangeInfo, java.io.Serializable, Values2D

public class DefaultBoxAndWhiskerCategoryDataset
extends AbstractDataset
implements BoxAndWhiskerCategoryDataset, RangeInfo

A convenience class that provides a default implementation of the BoxAndWhiskerCategoryDataset interface.

Author:
David Browning (for Australian Institute of Marine Science)
See Also:
Serialized Form

Field Summary
protected  KeyedObjects2D data
          Storage for the data.
 
Constructor Summary
DefaultBoxAndWhiskerCategoryDataset()
          Creates a new dataset.
 
Method Summary
 void add(BoxAndWhiskerItem item, java.lang.Comparable rowKey, java.lang.Comparable columnKey)
          Adds a list of values relating to one Box and Whisker entity to the table.
 void add(java.util.List list, java.lang.Comparable rowKey, java.lang.Comparable columnKey)
          Adds a list of values relating to one box-and-whisker entity to the table.
 boolean equals(java.lang.Object obj)
          Tests this dataset for equality with an arbitrary object.
 int getColumnCount()
          Returns the number of columns in the table.
 int getColumnIndex(java.lang.Comparable key)
          Returns the column index for a given key.
 java.lang.Comparable getColumnKey(int column)
          Returns a column key.
 java.util.List getColumnKeys()
          Returns the column keys.
 java.lang.Number getMaxOutlier(java.lang.Comparable rowKey, java.lang.Comparable columnKey)
          Returns the maximum outlier (non farout) value for an item.
 java.lang.Number getMaxOutlier(int row, int column)
          Returns the maximum outlier (non farout) value for an item.
 java.lang.Number getMaxRegularValue(java.lang.Comparable rowKey, java.lang.Comparable columnKey)
          Returns the maximum regular (non outlier) value for an item.
 java.lang.Number getMaxRegularValue(int row, int column)
          Returns the maximum regular (non outlier) value for an item.
 java.lang.Number getMeanValue(java.lang.Comparable rowKey, java.lang.Comparable columnKey)
          Returns the mean value for an item.
 java.lang.Number getMeanValue(int row, int column)
          Returns the mean value for an item.
 java.lang.Number getMedianValue(java.lang.Comparable rowKey, java.lang.Comparable columnKey)
          Returns the median value for an item.
 java.lang.Number getMedianValue(int row, int column)
          Returns the median value for an item.
 java.lang.Number getMinOutlier(java.lang.Comparable rowKey, java.lang.Comparable columnKey)
          Returns the minimum outlier (non farout) value for an item.
 java.lang.Number getMinOutlier(int row, int column)
          Returns the minimum outlier (non farout) value for an item.
 java.lang.Number getMinRegularValue(java.lang.Comparable rowKey, java.lang.Comparable columnKey)
          Returns the minimum regular (non outlier) value for an item.
 java.lang.Number getMinRegularValue(int row, int column)
          Returns the minimum regular (non outlier) value for an item.
 java.util.List getOutliers(java.lang.Comparable rowKey, java.lang.Comparable columnKey)
          Returns a list of outlier values for an item.
 java.util.List getOutliers(int row, int column)
          Returns a list of outlier values for an item.
 java.lang.Number getQ1Value(java.lang.Comparable rowKey, java.lang.Comparable columnKey)
          Returns the first quartile value.
 java.lang.Number getQ1Value(int row, int column)
          Returns the first quartile value.
 java.lang.Number getQ3Value(java.lang.Comparable rowKey, java.lang.Comparable columnKey)
          Returns the third quartile value.
 java.lang.Number getQ3Value(int row, int column)
          Returns the third quartile value.
 Range getRangeBounds(boolean includeInterval)
          Returns the range of the values in this dataset's range.
 double getRangeLowerBound(boolean includeInterval)
          Returns the minimum y-value in the dataset.
 double getRangeUpperBound(boolean includeInterval)
          Returns the maximum y-value in the dataset.
 int getRowCount()
          Returns the number of rows in the table.
 int getRowIndex(java.lang.Comparable key)
          Returns the row index for a given key.
 java.lang.Comparable getRowKey(int row)
          Returns a row key.
 java.util.List getRowKeys()
          Returns the row keys.
 java.lang.Number getValue(java.lang.Comparable rowKey, java.lang.Comparable columnKey)
          Returns the value for an item.
 java.lang.Number getValue(int row, int column)
          Returns the value for an item.
 
Methods inherited from class org.jfree.data.general.AbstractDataset
addChangeListener, clone, fireDatasetChanged, getGroup, notifyListeners, removeChangeListener, setGroup, validateObject
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jfree.data.general.Dataset
addChangeListener, getGroup, removeChangeListener, setGroup
 

Field Detail

data

protected KeyedObjects2D data
Storage for the data.

Constructor Detail

DefaultBoxAndWhiskerCategoryDataset

public DefaultBoxAndWhiskerCategoryDataset()
Creates a new dataset.

Method Detail

add

public void add(java.util.List list,
                java.lang.Comparable rowKey,
                java.lang.Comparable columnKey)
Adds a list of values relating to one box-and-whisker entity to the table. The various median values are calculated.

Parameters:
list - a collection of values from which the various medians will be calculated.
rowKey - the row key.
columnKey - the column key.

add

public void add(BoxAndWhiskerItem item,
                java.lang.Comparable rowKey,
                java.lang.Comparable columnKey)
Adds a list of values relating to one Box and Whisker entity to the table. The various median values are calculated.

Parameters:
item - a box and whisker item.
rowKey - the row key.
columnKey - the column key.

getValue

public java.lang.Number getValue(int row,
                                 int column)
Returns the value for an item.

Specified by:
getValue in interface Values2D
Parameters:
row - the row index.
column - the column index.
Returns:
The value.

getValue

public java.lang.Number getValue(java.lang.Comparable rowKey,
                                 java.lang.Comparable columnKey)
Returns the value for an item.

Specified by:
getValue in interface KeyedValues2D
Parameters:
rowKey - the row key.
columnKey - the columnKey.
Returns:
The value.

getMeanValue

public java.lang.Number getMeanValue(int row,
                                     int column)
Returns the mean value for an item.

Specified by:
getMeanValue in interface BoxAndWhiskerCategoryDataset
Parameters:
row - the row index (zero-based).
column - the column index (zero-based).
Returns:
The mean value.

getMeanValue

public java.lang.Number getMeanValue(java.lang.Comparable rowKey,
                                     java.lang.Comparable columnKey)
Returns the mean value for an item.

Specified by:
getMeanValue in interface BoxAndWhiskerCategoryDataset
Parameters:
rowKey - the row key.
columnKey - the column key.
Returns:
The mean value.

getMedianValue

public java.lang.Number getMedianValue(int row,
                                       int column)
Returns the median value for an item.

Specified by:
getMedianValue in interface BoxAndWhiskerCategoryDataset
Parameters:
row - the row index (zero-based).
column - the column index (zero-based).
Returns:
The median value.

getMedianValue

public java.lang.Number getMedianValue(java.lang.Comparable rowKey,
                                       java.lang.Comparable columnKey)
Returns the median value for an item.

Specified by:
getMedianValue in interface BoxAndWhiskerCategoryDataset
Parameters:
rowKey - the row key.
columnKey - the columnKey.
Returns:
The median value.

getQ1Value

public java.lang.Number getQ1Value(int row,
                                   int column)
Returns the first quartile value.

Specified by:
getQ1Value in interface BoxAndWhiskerCategoryDataset
Parameters:
row - the row index (zero-based).
column - the column index (zero-based).
Returns:
The first quartile value.

getQ1Value

public java.lang.Number getQ1Value(java.lang.Comparable rowKey,
                                   java.lang.Comparable columnKey)
Returns the first quartile value.

Specified by:
getQ1Value in interface BoxAndWhiskerCategoryDataset
Parameters:
rowKey - the row key.
columnKey - the column key.
Returns:
The first quartile value.

getQ3Value

public java.lang.Number getQ3Value(int row,
                                   int column)
Returns the third quartile value.

Specified by:
getQ3Value in interface BoxAndWhiskerCategoryDataset
Parameters:
row - the row index (zero-based).
column - the column index (zero-based).
Returns:
The third quartile value.

getQ3Value

public java.lang.Number getQ3Value(java.lang.Comparable rowKey,
                                   java.lang.Comparable columnKey)
Returns the third quartile value.

Specified by:
getQ3Value in interface BoxAndWhiskerCategoryDataset
Parameters:
rowKey - the row key.
columnKey - the column key.
Returns:
The third quartile value.

getColumnIndex

public int getColumnIndex(java.lang.Comparable key)
Returns the column index for a given key.

Specified by:
getColumnIndex in interface KeyedValues2D
Parameters:
key - the column key.
Returns:
The column index.

getColumnKey

public java.lang.Comparable getColumnKey(int column)
Returns a column key.

Specified by:
getColumnKey in interface KeyedValues2D
Parameters:
column - the column index (zero-based).
Returns:
The column key.

getColumnKeys

public java.util.List getColumnKeys()
Returns the column keys.

Specified by:
getColumnKeys in interface KeyedValues2D
Returns:
The keys.

getRowIndex

public int getRowIndex(java.lang.Comparable key)
Returns the row index for a given key.

Specified by:
getRowIndex in interface KeyedValues2D
Parameters:
key - the row key.
Returns:
The row index.

getRowKey

public java.lang.Comparable getRowKey(int row)
Returns a row key.

Specified by:
getRowKey in interface KeyedValues2D
Parameters:
row - the row index (zero-based).
Returns:
The row key.

getRowKeys

public java.util.List getRowKeys()
Returns the row keys.

Specified by:
getRowKeys in interface KeyedValues2D
Returns:
The keys.

getRowCount

public int getRowCount()
Returns the number of rows in the table.

Specified by:
getRowCount in interface Values2D
Returns:
The row count.

getColumnCount

public int getColumnCount()
Returns the number of columns in the table.

Specified by:
getColumnCount in interface Values2D
Returns:
The column count.

getRangeLowerBound

public double getRangeLowerBound(boolean includeInterval)
Returns the minimum y-value in the dataset.

Specified by:
getRangeLowerBound in interface RangeInfo
Parameters:
includeInterval - a flag that determines whether or not the y-interval is taken into account.
Returns:
The minimum value.

getRangeUpperBound

public double getRangeUpperBound(boolean includeInterval)
Returns the maximum y-value in the dataset.

Specified by:
getRangeUpperBound in interface RangeInfo
Parameters:
includeInterval - a flag that determines whether or not the y-interval is taken into account.
Returns:
The maximum value.

getRangeBounds

public Range getRangeBounds(boolean includeInterval)
Returns the range of the values in this dataset's range.

Specified by:
getRangeBounds in interface RangeInfo
Parameters:
includeInterval - a flag that determines whether or not the y-interval is taken into account.
Returns:
The range.

getMinRegularValue

public java.lang.Number getMinRegularValue(int row,
                                           int column)
Returns the minimum regular (non outlier) value for an item.

Specified by:
getMinRegularValue in interface BoxAndWhiskerCategoryDataset
Parameters:
row - the row index (zero-based).
column - the column index (zero-based).
Returns:
The minimum regular value.

getMinRegularValue

public java.lang.Number getMinRegularValue(java.lang.Comparable rowKey,
                                           java.lang.Comparable columnKey)
Returns the minimum regular (non outlier) value for an item.

Specified by:
getMinRegularValue in interface BoxAndWhiskerCategoryDataset
Parameters:
rowKey - the row key.
columnKey - the column key.
Returns:
The minimum regular value.

getMaxRegularValue

public java.lang.Number getMaxRegularValue(int row,
                                           int column)
Returns the maximum regular (non outlier) value for an item.

Specified by:
getMaxRegularValue in interface BoxAndWhiskerCategoryDataset
Parameters:
row - the row index (zero-based).
column - the column index (zero-based).
Returns:
The maximum regular value.

getMaxRegularValue

public java.lang.Number getMaxRegularValue(java.lang.Comparable rowKey,
                                           java.lang.Comparable columnKey)
Returns the maximum regular (non outlier) value for an item.

Specified by:
getMaxRegularValue in interface BoxAndWhiskerCategoryDataset
Parameters:
rowKey - the row key.
columnKey - the column key.
Returns:
The maximum regular value.

getMinOutlier

public java.lang.Number getMinOutlier(int row,
                                      int column)
Returns the minimum outlier (non farout) value for an item.

Specified by:
getMinOutlier in interface BoxAndWhiskerCategoryDataset
Parameters:
row - the row index (zero-based).
column - the column index (zero-based).
Returns:
The minimum outlier.

getMinOutlier

public java.lang.Number getMinOutlier(java.lang.Comparable rowKey,
                                      java.lang.Comparable columnKey)
Returns the minimum outlier (non farout) value for an item.

Specified by:
getMinOutlier in interface BoxAndWhiskerCategoryDataset
Parameters:
rowKey - the row key.
columnKey - the column key.
Returns:
The minimum outlier.

getMaxOutlier

public java.lang.Number getMaxOutlier(int row,
                                      int column)
Returns the maximum outlier (non farout) value for an item.

Specified by:
getMaxOutlier in interface BoxAndWhiskerCategoryDataset
Parameters:
row - the row index (zero-based).
column - the column index (zero-based).
Returns:
The maximum outlier.

getMaxOutlier

public java.lang.Number getMaxOutlier(java.lang.Comparable rowKey,
                                      java.lang.Comparable columnKey)
Returns the maximum outlier (non farout) value for an item.

Specified by:
getMaxOutlier in interface BoxAndWhiskerCategoryDataset
Parameters:
rowKey - the row key.
columnKey - the column key.
Returns:
The maximum outlier.

getOutliers

public java.util.List getOutliers(int row,
                                  int column)
Returns a list of outlier values for an item.

Specified by:
getOutliers in interface BoxAndWhiskerCategoryDataset
Parameters:
row - the row index (zero-based).
column - the column index (zero-based).
Returns:
A list of outlier values.

getOutliers

public java.util.List getOutliers(java.lang.Comparable rowKey,
                                  java.lang.Comparable columnKey)
Returns a list of outlier values for an item.

Specified by:
getOutliers in interface BoxAndWhiskerCategoryDataset
Parameters:
rowKey - the row key.
columnKey - the column key.
Returns:
A list of outlier values.

equals

public boolean equals(java.lang.Object obj)
Tests this dataset for equality with an arbitrary object.

Parameters:
obj - the object to test against (null permitted).
Returns:
A boolean.