Example usage for org.jfree.data.statistics SimpleHistogramBin getUpperBound

List of usage examples for org.jfree.data.statistics SimpleHistogramBin getUpperBound

Introduction

In this page you can find the example usage for org.jfree.data.statistics SimpleHistogramBin getUpperBound.

Prototype

public double getUpperBound() 

Source Link

Document

Return the upper bound.

Usage

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

/**
 * Returns the end x-value (as a double primitive) for an item within a
 * series.//from w ww .j a v  a  2s  .  c o  m
 *
 * @param series  the series index (zero-based).
 * @param item  the item index (zero-based).
 *
 * @return The end x-value.
 */
@Override
public double getEndXValue(int series, int item) {
    SimpleHistogramBin bin = (SimpleHistogramBin) this.bins.get(item);
    return bin.getUpperBound();
}

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

/**
 * Returns the x-value (as a double primitive) for an item within a series.
 *
 * @param series  the series index (zero-based).
 * @param item  the item index (zero-based).
 *
 * @return The x-value.//from w w w.  j av  a  2s.  c  o m
 */
@Override
public double getXValue(int series, int item) {
    SimpleHistogramBin bin = (SimpleHistogramBin) this.bins.get(item);
    return (bin.getLowerBound() + bin.getUpperBound()) / 2.0;
}

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

/**
 * Returns the y-value (as a double primitive) for an item within a series.
 *
 * @param series  the series index (zero-based).
 * @param item  the item index (zero-based).
 *
 * @return The y-value./*from   www  .j  av  a  2  s.  co m*/
 *
 * @see #getAdjustForBinSize()
 */
@Override
public double getYValue(int series, int item) {
    SimpleHistogramBin bin = (SimpleHistogramBin) this.bins.get(item);
    if (this.adjustForBinSize) {
        return bin.getItemCount() / (bin.getUpperBound() - bin.getLowerBound());
    } else {
        return bin.getItemCount();
    }
}