Example usage for org.jfree.data DomainInfo getDomainBounds

List of usage examples for org.jfree.data DomainInfo getDomainBounds

Introduction

In this page you can find the example usage for org.jfree.data DomainInfo getDomainBounds.

Prototype

public Range getDomainBounds(boolean includeInterval);

Source Link

Document

Returns the range of the values in this dataset's domain.

Usage

From source file:org.jfree.data.general.DatasetUtils.java

/**
 * Returns the range of values in the domain (x-values) of a dataset.
 *
 * @param dataset  the dataset ({@code null} not permitted).
 * @param includeInterval  determines whether or not the x-interval is taken
 *                         into account (only applies if the dataset is an
 *                         {@link IntervalXYDataset}).
 *
 * @return The range of values (possibly {@code null}).
 *//*w w w  .  j  av  a 2s  . co m*/
public static Range findDomainBounds(XYDataset dataset, boolean includeInterval) {

    Args.nullNotPermitted(dataset, "dataset");

    Range result;
    // if the dataset implements DomainInfo, life is easier
    if (dataset instanceof DomainInfo) {
        DomainInfo info = (DomainInfo) dataset;
        result = info.getDomainBounds(includeInterval);
    } else {
        result = iterateDomainBounds(dataset, includeInterval);
    }
    return result;

}

From source file:org.jfree.data.general.DatasetUtilities.java

/**
 * Returns the range of values in the domain (x-values) of a dataset.
 *
 * @param dataset  the dataset (<code>null</code> not permitted).
 * @param includeInterval  determines whether or not the x-interval is taken
 *                         into account (only applies if the dataset is an
 *                         {@link IntervalXYDataset}).
 *
 * @return The range of values (possibly <code>null</code>).
 *///from   ww w  .  j  a va2s. c  o m
public static Range findDomainBounds(XYDataset dataset, boolean includeInterval) {

    ParamChecks.nullNotPermitted(dataset, "dataset");

    Range result;
    // if the dataset implements DomainInfo, life is easier
    if (dataset instanceof DomainInfo) {
        DomainInfo info = (DomainInfo) dataset;
        result = info.getDomainBounds(includeInterval);
    } else {
        result = iterateDomainBounds(dataset, includeInterval);
    }
    return result;

}