📄 defaultboxandwhiskercategorydataset.java
字号:
/**
* Returns the number of columns in the table.
*
* @return the column count.
*/
public int getColumnCount() {
return this.data.getColumnCount();
}
/**
* Adds a list of values relating to one Box and Whisker entity to the table.
* The various median values are calculated.
*
* @param list a collection of values from which the various medians will be calculated.
* @param rowKey the row key.
* @param columnKey the column key.
*/
public void add(final List list, final Comparable rowKey, final Comparable columnKey) {
final BoxAndWhiskerItem item
= BoxAndWhiskerCalculator.calculateBoxAndWhiskerStatistics(list);
add(item, rowKey, columnKey);
}
/**
* Adds a list of values relating to one Box and Whisker entity to the table.
* The various median values are calculated.
*
* @param item a box and whisker item.
* @param rowKey the row key.
* @param columnKey the column key.
*/
public void add(final BoxAndWhiskerItem item,
final Comparable rowKey,
final Comparable columnKey) {
this.data.addObject(item, rowKey, columnKey);
final double minval = item.getMinOutlier().doubleValue();
final double maxval = item.getMaxOutlier().doubleValue();
if (this.maximumRangeValue == null) {
this.maximumRangeValue = new Double(maxval);
}
else if (maxval > this.maximumRangeValue.doubleValue()) {
this.maximumRangeValue = new Double(maxval);
}
if (this.minimumRangeValue == null) {
this.minimumRangeValue = new Double(minval);
}
else if (minval < this.minimumRangeValue.doubleValue()) {
this.minimumRangeValue = new Double(minval);
}
this.valueRange = new Range(this.minimumRangeValue.doubleValue(),
this.maximumRangeValue.doubleValue());
fireDatasetChanged();
}
/**
* Returns the minimum value in the dataset's range (or null if all the
* values in the range are null).
*
* @return the minimum value.
*/
public Number getMinimumRangeValue() {
return this.minimumRangeValue;
}
/**
* Returns the maximum value in the dataset's range (or null if all the
* values in the range are null).
*
* @return the maximum value.
*/
public Number getMaximumRangeValue() {
return this.maximumRangeValue;
}
/**
* Returns the range of the values in this dataset's range.
*
* @return the range.
*/
public Range getValueRange() {
return this.valueRange;
}
// public Number getInterquartileRangeValue(int row, int column) {
//
// Number result = null;
// QuartileCalculator qCalc = (QuartileCalculator) this.data.getObject(row, column);
// if (qCalc != null) {
// result = new Double(qCalc.getInterquartileRange());
// }
// return result;
//
// }
//
// public Number getInterquartileRangeValue(Comparable rowKey, Comparable columnKey) {
//
// Number result = null;
// QuartileCalculator qCalc = (QuartileCalculator) this.data.getObject(rowKey, columnKey);
// if (qCalc != null) {
// result = new Double(qCalc.getInterquartileRange());
// }
// return result;
//
// }
/**
* Returns the minimum regular (non outlier) value for an item.
*
* @param row the row index (zero-based).
* @param column the column index (zero-based).
*
* @return The minimum regular value.
*/
public Number getMinRegularValue(final int row, final int column) {
Number result = null;
final BoxAndWhiskerItem item = (BoxAndWhiskerItem) this.data.getObject(row, column);
if (item != null) {
result = item.getMinRegularValue();
}
return result;
}
/**
* Returns the minimum regular (non outlier) value for an item.
*
* @param rowKey the row key.
* @param columnKey the column key.
*
* @return The minimum regular value.
*/
public Number getMinRegularValue(final Comparable rowKey, final Comparable columnKey) {
Number result = null;
final BoxAndWhiskerItem item = (BoxAndWhiskerItem) this.data.getObject(rowKey, columnKey);
if (item != null) {
result = item.getMinRegularValue();
}
return result;
}
/**
* Returns the maximum regular (non outlier) value for an item.
*
* @param row the row index (zero-based).
* @param column the column index (zero-based).
*
* @return The maximum regular value.
*/
public Number getMaxRegularValue(final int row, final int column) {
Number result = null;
final BoxAndWhiskerItem item = (BoxAndWhiskerItem) this.data.getObject(row, column);
if (item != null) {
result = item.getMaxRegularValue();
}
return result;
}
/**
* Returns the maximum regular (non outlier) value for an item.
*
* @param rowKey the row key.
* @param columnKey the column key.
*
* @return The maximum regular value.
*/
public Number getMaxRegularValue(final Comparable rowKey, final Comparable columnKey) {
Number result = null;
final BoxAndWhiskerItem item = (BoxAndWhiskerItem) this.data.getObject(rowKey, columnKey);
if (item != null) {
result = item.getMaxRegularValue();
}
return result;
}
/**
* Returns the minimum outlier (non farout) value for an item.
*
* @param row the row index (zero-based).
* @param column the column index (zero-based).
*
* @return The minimum outlier.
*/
public Number getMinOutlier(final int row, final int column) {
Number result = null;
final BoxAndWhiskerItem item = (BoxAndWhiskerItem) this.data.getObject(row, column);
if (item != null) {
result = item.getMinOutlier();
}
return result;
}
/**
* Returns the minimum outlier (non farout) value for an item.
*
* @param rowKey the row key.
* @param columnKey the column key.
*
* @return The minimum outlier.
*/
public Number getMinOutlier(final Comparable rowKey, final Comparable columnKey) {
Number result = null;
final BoxAndWhiskerItem item = (BoxAndWhiskerItem) this.data.getObject(rowKey, columnKey);
if (item != null) {
result = item.getMinOutlier();
}
return result;
}
/**
* Returns the maximum outlier (non farout) value for an item.
*
* @param row the row index (zero-based).
* @param column the column index (zero-based).
*
* @return The maximum outlier.
*/
public Number getMaxOutlier(final int row, final int column) {
Number result = null;
final BoxAndWhiskerItem item = (BoxAndWhiskerItem) this.data.getObject(row, column);
if (item != null) {
result = item.getMaxOutlier();
}
return result;
}
/**
* Returns the maximum outlier (non farout) value for an item.
*
* @param rowKey the row key.
* @param columnKey the column key.
*
* @return The maximum outlier.
*/
public Number getMaxOutlier(final Comparable rowKey, final Comparable columnKey) {
Number result = null;
final BoxAndWhiskerItem item = (BoxAndWhiskerItem) this.data.getObject(rowKey, columnKey);
if (item != null) {
result = item.getMaxOutlier();
}
return result;
}
/**
* Returns a list of outlier values for an item.
*
* @param row the row index (zero-based).
* @param column the column index (zero-based).
*
* @return A list of outlier values.
*/
public List getOutliers(final int row, final int column) {
List result = null;
final BoxAndWhiskerItem item = (BoxAndWhiskerItem) this.data.getObject(row, column);
if (item != null) {
result = item.getOutliers();
}
return result;
}
/**
* Returns a list of outlier values for an item.
*
* @param rowKey the row key.
* @param columnKey the column key.
*
* @return A list of outlier values.
*/
public List getOutliers(final Comparable rowKey, final Comparable columnKey) {
List result = null;
final BoxAndWhiskerItem item = (BoxAndWhiskerItem) this.data.getObject(rowKey, columnKey);
if (item != null) {
result = item.getOutliers();
}
return result;
}
/**
* Tests this dataset for equality with an arbitrary object.
*
* @param obj the object to test against (<code>null</code> permitted).
*
* @return a boolean.
*/
public boolean equals(final Object obj) {
if (obj == null) {
return false;
}
if (obj == this) {
return true;
}
if (obj instanceof DefaultBoxAndWhiskerCategoryDataset) {
final DefaultBoxAndWhiskerCategoryDataset dataset
= (DefaultBoxAndWhiskerCategoryDataset) obj;
return ObjectUtils.equal(this.data, dataset.data);
}
return false;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -