Example usage for org.jfree.data.statistics BoxAndWhiskerItem getMinOutlier

List of usage examples for org.jfree.data.statistics BoxAndWhiskerItem getMinOutlier

Introduction

In this page you can find the example usage for org.jfree.data.statistics BoxAndWhiskerItem getMinOutlier.

Prototype

public Number getMinOutlier() 

Source Link

Document

Returns the minimum outlier.

Usage

From source file:gui.TraitViewerDialog.java

private String showBoxAndWhiskerItem(BoxAndWhiskerItem a) {
    String r = "";
    r += "mean: " + a.getMean() + "\n";
    r += "median: " + a.getMedian() + "\n";
    r += "25%: " + a.getQ1() + "\n";
    r += "75%: " + a.getQ3() + "\n";
    r += "minreg: " + a.getMinRegularValue() + "\n";
    r += "maxreg: " + a.getMaxRegularValue() + "\n";
    r += "minoutl: " + a.getMinOutlier() + "\n";
    r += "maxoutl: " + a.getMaxOutlier() + "\n";
    if (a.getOutliers() != null) {
        r += "outliers: " + a.getOutliers().toString() + "\n";
    }//from   ww w.java 2 s  .  c  o  m
    return r;
}

From source file:org.jfree.data.statistics.DefaultBoxAndWhiskerXYDataset.java

/**
 * Returns the minimum value which is not a farout.
 * @param series  the series (zero-based index).
 * @param item  the item (zero-based index).
 *
 * @return A <code>Number</code> representing the maximum non-farout value.
 *///from  w w w.j  ava  2  s  . c om
@Override
public Number getMinOutlier(int series, int item) {
    Number result = null;
    BoxAndWhiskerItem stats = this.items.get(item);
    if (stats != null) {
        result = stats.getMinOutlier();
    }
    return result;
}

From source file:org.jfree.data.statistics.DefaultBoxAndWhiskerCategoryDataset.java

/**
 * 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.//w ww .  j a v a2  s .c  o m
 *
 * @see #getItem(int, int)
 */
@Override
public Number getMinOutlier(int row, int column) {
    Number result = null;
    BoxAndWhiskerItem item = (BoxAndWhiskerItem) this.data.getObject(row, column);
    if (item != null) {
        result = item.getMinOutlier();
    }
    return result;
}

From source file:org.jfree.data.statistics.DefaultBoxAndWhiskerCategoryDataset.java

/**
 * Returns the minimum outlier (non farout) value for an item.
 *
 * @param rowKey  the row key./*from   w w w .  j a v  a  2 s .c o  m*/
 * @param columnKey  the column key.
 *
 * @return The minimum outlier.
 *
 * @see #getItem(int, int)
 */
@Override
public Number getMinOutlier(Comparable rowKey, Comparable columnKey) {
    Number result = null;
    BoxAndWhiskerItem item = (BoxAndWhiskerItem) this.data.getObject(rowKey, columnKey);
    if (item != null) {
        result = item.getMinOutlier();
    }
    return result;
}

From source file:org.jfree.data.statistics.DefaultBoxAndWhiskerCategoryDataset.java

/**
 * Resets the cached bounds, by iterating over the entire dataset to find
 * the current bounds.//w  w w .j  a v  a  2s. c o  m
 */
private void updateBounds() {
    this.minimumRangeValue = Double.NaN;
    this.minimumRangeValueRow = -1;
    this.minimumRangeValueColumn = -1;
    this.maximumRangeValue = Double.NaN;
    this.maximumRangeValueRow = -1;
    this.maximumRangeValueColumn = -1;
    int rowCount = getRowCount();
    int columnCount = getColumnCount();
    for (int r = 0; r < rowCount; r++) {
        for (int c = 0; c < columnCount; c++) {
            BoxAndWhiskerItem item = getItem(r, c);
            if (item != null) {
                Number min = item.getMinOutlier();
                if (min != null) {
                    double minv = min.doubleValue();
                    if (!Double.isNaN(minv)) {
                        if (minv < this.minimumRangeValue || Double.isNaN(this.minimumRangeValue)) {
                            this.minimumRangeValue = minv;
                            this.minimumRangeValueRow = r;
                            this.minimumRangeValueColumn = c;
                        }
                    }
                }
                Number max = item.getMaxOutlier();
                if (max != null) {
                    double maxv = max.doubleValue();
                    if (!Double.isNaN(maxv)) {
                        if (maxv > this.maximumRangeValue || Double.isNaN(this.maximumRangeValue)) {
                            this.maximumRangeValue = maxv;
                            this.maximumRangeValueRow = r;
                            this.maximumRangeValueColumn = c;
                        }
                    }
                }
            }
        }
    }
}

From source file:org.jfree.data.statistics.DefaultBoxAndWhiskerCategoryDataset.java

/**
 * 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 (<code>null</code> not permitted).
 * @param rowKey  the row key (<code>null</code> not permitted).
 * @param columnKey  the column key (<code>null</code> not permitted).
 *
 * @see #add(List, Comparable, Comparable)
 */// w w w .  j  av  a 2  s .c  o  m
public void add(BoxAndWhiskerItem item, Comparable rowKey, Comparable columnKey) {

    this.data.addObject(item, rowKey, columnKey);

    // update cached min and max values
    int r = this.data.getRowIndex(rowKey);
    int c = this.data.getColumnIndex(columnKey);
    if ((this.maximumRangeValueRow == r && this.maximumRangeValueColumn == c)
            || (this.minimumRangeValueRow == r && this.minimumRangeValueColumn == c)) {
        updateBounds();
    } else {

        double minval = Double.NaN;
        if (item.getMinOutlier() != null) {
            minval = item.getMinOutlier().doubleValue();
        }
        double maxval = Double.NaN;
        if (item.getMaxOutlier() != null) {
            maxval = item.getMaxOutlier().doubleValue();
        }

        if (Double.isNaN(this.maximumRangeValue)) {
            this.maximumRangeValue = maxval;
            this.maximumRangeValueRow = r;
            this.maximumRangeValueColumn = c;
        } else if (maxval > this.maximumRangeValue) {
            this.maximumRangeValue = maxval;
            this.maximumRangeValueRow = r;
            this.maximumRangeValueColumn = c;
        }

        if (Double.isNaN(this.minimumRangeValue)) {
            this.minimumRangeValue = minval;
            this.minimumRangeValueRow = r;
            this.minimumRangeValueColumn = c;
        } else if (minval < this.minimumRangeValue) {
            this.minimumRangeValue = minval;
            this.minimumRangeValueRow = r;
            this.minimumRangeValueColumn = c;
        }
    }

    fireDatasetChanged();

}