当前位置: 首页>>代码示例>>Java>>正文


Java DomainInfo.getDomainUpperBound方法代码示例

本文整理汇总了Java中org.jfree.data.DomainInfo.getDomainUpperBound方法的典型用法代码示例。如果您正苦于以下问题:Java DomainInfo.getDomainUpperBound方法的具体用法?Java DomainInfo.getDomainUpperBound怎么用?Java DomainInfo.getDomainUpperBound使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jfree.data.DomainInfo的用法示例。


在下文中一共展示了DomainInfo.getDomainUpperBound方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: findMaximumDomainValue

import org.jfree.data.DomainInfo; //导入方法依赖的package包/类
/**
 * Returns the maximum domain value for the specified dataset.  This is 
 * easy if the dataset implements the {@link DomainInfo} interface (a good 
 * idea if there is an efficient way to determine the maximum value).  
 * Otherwise, it involves iterating over the entire data-set.  Returns 
 * <code>null</code> if all the data values in the dataset are 
 * <code>null</code>.
 *
 * @param dataset  the dataset (<code>null</code> not permitted).
 *
 * @return The maximum value (possibly <code>null</code>).
 */
public static Number findMaximumDomainValue(XYDataset dataset) {
    if (dataset == null) {
        throw new IllegalArgumentException("Null 'dataset' argument.");
    }
    Number result = null;
    // if the dataset implements DomainInfo, life is easy
    if (dataset instanceof DomainInfo) {
        DomainInfo info = (DomainInfo) dataset;
        return new Double(info.getDomainUpperBound(true));
    }

    // hasn't implemented DomainInfo, so iterate...
    else {
        double maximum = Double.NEGATIVE_INFINITY;
        int seriesCount = dataset.getSeriesCount();
        for (int series = 0; series < seriesCount; series++) {
            int itemCount = dataset.getItemCount(series);
            for (int item = 0; item < itemCount; item++) {

                double value;
                if (dataset instanceof IntervalXYDataset) {
                    IntervalXYDataset intervalXYData 
                        = (IntervalXYDataset) dataset;
                    value = intervalXYData.getEndXValue(series, item);
                }
                else {
                    value = dataset.getXValue(series, item);
                }
                if (!Double.isNaN(value)) {
                    maximum = Math.max(maximum, value);
                }
            }
        }
        if (maximum == Double.NEGATIVE_INFINITY) {
            result = null;
        }
        else {
            result = new Double(maximum);
        }

    }
    
    return result;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:57,代码来源:DatasetUtilities.java

示例2: findMaximumDomainValue

import org.jfree.data.DomainInfo; //导入方法依赖的package包/类
/**
 * Returns the maximum domain value for the specified dataset.  This is
 * easy if the dataset implements the {@link DomainInfo} interface (a good
 * idea if there is an efficient way to determine the maximum value).
 * Otherwise, it involves iterating over the entire data-set.  Returns
 * <code>null</code> if all the data values in the dataset are
 * <code>null</code>.
 *
 * @param dataset  the dataset (<code>null</code> not permitted).
 *
 * @return The maximum value (possibly <code>null</code>).
 */
public static Number findMaximumDomainValue(XYDataset dataset) {
    ParamChecks.nullNotPermitted(dataset, "dataset");
    Number result;
    // if the dataset implements DomainInfo, life is easy
    if (dataset instanceof DomainInfo) {
        DomainInfo info = (DomainInfo) dataset;
        return new Double(info.getDomainUpperBound(true));
    }

    // hasn't implemented DomainInfo, so iterate...
    else {
        double maximum = Double.NEGATIVE_INFINITY;
        int seriesCount = dataset.getSeriesCount();
        for (int series = 0; series < seriesCount; series++) {
            int itemCount = dataset.getItemCount(series);
            for (int item = 0; item < itemCount; item++) {

                double value;
                if (dataset instanceof IntervalXYDataset) {
                    IntervalXYDataset intervalXYData
                        = (IntervalXYDataset) dataset;
                    value = intervalXYData.getEndXValue(series, item);
                }
                else {
                    value = dataset.getXValue(series, item);
                }
                if (!Double.isNaN(value)) {
                    maximum = Math.max(maximum, value);
                }
            }
        }
        if (maximum == Double.NEGATIVE_INFINITY) {
            result = null;
        }
        else {
            result = new Double(maximum);
        }

    }

    return result;
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:55,代码来源:DatasetUtilities.java

示例3: findMaximumDomainValue

import org.jfree.data.DomainInfo; //导入方法依赖的package包/类
/**
 * Returns the maximum domain value for the specified dataset.  This is
 * easy if the dataset implements the {@link DomainInfo} interface (a good
 * idea if there is an efficient way to determine the maximum value).
 * Otherwise, it involves iterating over the entire data-set.  Returns
 * {@code null} if all the data values in the dataset are
 * {@code null}.
 *
 * @param dataset  the dataset ({@code null} not permitted).
 *
 * @return The maximum value (possibly {@code null}).
 */
public static Number findMaximumDomainValue(XYDataset dataset) {
    Args.nullNotPermitted(dataset, "dataset");
    Number result;
    // if the dataset implements DomainInfo, life is easy
    if (dataset instanceof DomainInfo) {
        DomainInfo info = (DomainInfo) dataset;
        return new Double(info.getDomainUpperBound(true));
    }

    // hasn't implemented DomainInfo, so iterate...
    else {
        double maximum = Double.NEGATIVE_INFINITY;
        int seriesCount = dataset.getSeriesCount();
        for (int series = 0; series < seriesCount; series++) {
            int itemCount = dataset.getItemCount(series);
            for (int item = 0; item < itemCount; item++) {

                double value;
                if (dataset instanceof IntervalXYDataset) {
                    IntervalXYDataset intervalXYData
                        = (IntervalXYDataset) dataset;
                    value = intervalXYData.getEndXValue(series, item);
                }
                else {
                    value = dataset.getXValue(series, item);
                }
                if (!Double.isNaN(value)) {
                    maximum = Math.max(maximum, value);
                }
            }
        }
        if (maximum == Double.NEGATIVE_INFINITY) {
            result = null;
        }
        else {
            result = new Double(maximum);
        }

    }

    return result;
}
 
开发者ID:jfree,项目名称:jfreechart,代码行数:55,代码来源:DatasetUtils.java

示例4: findMaximumDomainValue

import org.jfree.data.DomainInfo; //导入方法依赖的package包/类
/**
 * Returns the maximum domain value for the specified dataset.  This is
 * easy if the dataset implements the {@link DomainInfo} interface (a good
 * idea if there is an efficient way to determine the maximum value).
 * Otherwise, it involves iterating over the entire data-set.  Returns
 * <code>null</code> if all the data values in the dataset are
 * <code>null</code>.
 *
 * @param dataset  the dataset (<code>null</code> not permitted).
 *
 * @return The maximum value (possibly <code>null</code>).
 */
public static Number findMaximumDomainValue(XYDataset dataset) {
    if (dataset == null) {
        throw new IllegalArgumentException("Null 'dataset' argument.");
    }
    Number result = null;
    // if the dataset implements DomainInfo, life is easy
    if (dataset instanceof DomainInfo) {
        DomainInfo info = (DomainInfo) dataset;
        return new Double(info.getDomainUpperBound(true));
    }

    // hasn't implemented DomainInfo, so iterate...
    else {
        double maximum = Double.NEGATIVE_INFINITY;
        int seriesCount = dataset.getSeriesCount();
        for (int series = 0; series < seriesCount; series++) {
            int itemCount = dataset.getItemCount(series);
            for (int item = 0; item < itemCount; item++) {

                double value;
                if (dataset instanceof IntervalXYDataset) {
                    IntervalXYDataset intervalXYData
                        = (IntervalXYDataset) dataset;
                    value = intervalXYData.getEndXValue(series, item);
                }
                else {
                    value = dataset.getXValue(series, item);
                }
                if (!Double.isNaN(value)) {
                    maximum = Math.max(maximum, value);
                }
            }
        }
        if (maximum == Double.NEGATIVE_INFINITY) {
            result = null;
        }
        else {
            result = new Double(maximum);
        }

    }

    return result;
}
 
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:57,代码来源:DatasetUtilities.java


注:本文中的org.jfree.data.DomainInfo.getDomainUpperBound方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。