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


Java RangeInfo类代码示例

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


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

示例1: findRangeExtent

import org.jfree.data.RangeInfo; //导入依赖的package包/类
/**
 * Returns the range of values in the range for the dataset.  This method
 * is the partner for the getDomainExtent method.
 *
 * @param dataset  the dataset.
 *
 * @return The range of values in the range for the dataset.
 * 
 * @deprecated Use findRangeExtent(CategoryDataset) or findRangeExtent(XYDataset).
 */
public static Range findRangeExtent(Dataset dataset) {

    // check parameters...
    if (dataset == null) {
        return null;
    }
    
    // work out the minimum value...
    if (dataset instanceof RangeInfo) {
        RangeInfo info = (RangeInfo) dataset;
        return info.getValueRange();
    }

    // hasn't implemented RangeInfo, so we'll have to iterate...
    else if (dataset instanceof CategoryDataset) {
        return iterateCategoryRangeExtent((CategoryDataset) dataset);
    }
    // hasn't implemented RangeInfo, so we'll have to iterate...
    else if (dataset instanceof XYDataset) {
        return iterateXYRangeExtent((XYDataset) dataset);
    }
    else {
        return null;
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:36,代码来源:DatasetUtilities.java

示例2: findRangeBounds

import org.jfree.data.RangeInfo; //导入依赖的package包/类
/**
 * Returns the range of values in the range for the dataset.  This method
 * is the partner for the getDomainExtent method.
 *
 * @param dataset  the dataset (<code>null</code> not permitted).
 * @param includeInterval  a flag that determines whether or not the
 *                         y-interval is taken into account.
 * 
 * @return The range (possibly <code>null</code>).
 */
public static Range findRangeBounds(CategoryDataset dataset, 
                                    boolean includeInterval) {
    if (dataset == null) {
        throw new IllegalArgumentException("Null 'dataset' argument.");
    }
    Range result = null;
    if (dataset instanceof RangeInfo) {
        RangeInfo info = (RangeInfo) dataset;
        result = info.getRangeBounds(includeInterval);
    }
    else {
        result = iterateCategoryRangeBounds(dataset, includeInterval);
    }
    return result;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:26,代码来源:DatasetUtilities.java

示例3: findRangeBounds

import org.jfree.data.RangeInfo; //导入依赖的package包/类
/**
 * Returns the range of values in the range for the dataset.
 *
 * @param dataset  the dataset (<code>null</code> not permitted).
 * @param includeInterval  a flag that determines whether or not the
 *                         y-interval is taken into account.
 *
 * @return The range (possibly <code>null</code>).
 */
public static Range findRangeBounds(CategoryDataset dataset,
                                    boolean includeInterval) {
    if (dataset == null) {
        throw new IllegalArgumentException("Null 'dataset' argument.");
    }
    Range result = null;
    if (dataset instanceof RangeInfo) {
        RangeInfo info = (RangeInfo) dataset;
        result = info.getRangeBounds(includeInterval);
    }
    else {
        result = iterateRangeBounds(dataset, includeInterval);
    }
    return result;
}
 
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:25,代码来源:DatasetUtilities.java

示例4: findRangeBounds

import org.jfree.data.RangeInfo; //导入依赖的package包/类
/**
 * Returns the range of values in the range for the dataset.
 *
 * @param dataset  the dataset (<code>null</code> not permitted).
 * @param includeInterval  a flag that determines whether or not the
 *                         y-interval is taken into account.
 *
 * @return The range (possibly <code>null</code>).
 */
public static Range findRangeBounds(CategoryDataset dataset,
        boolean includeInterval) {
    ParamChecks.nullNotPermitted(dataset, "dataset");
    Range result;
    if (dataset instanceof RangeInfo) {
        RangeInfo info = (RangeInfo) dataset;
        result = info.getRangeBounds(includeInterval);
    }
    else {
        result = iterateRangeBounds(dataset, includeInterval);
    }
    return result;
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:23,代码来源:DatasetUtilities.java

示例5: findMinimumRangeValue

import org.jfree.data.RangeInfo; //导入依赖的package包/类
/**
 * Returns the minimum range value for the specified dataset.  This is
 * easy if the dataset implements the {@link RangeInfo} interface (a good
 * idea if there is an efficient way to determine the minimum 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 minimum value (possibly <code>null</code>).
 */
public static Number findMinimumRangeValue(CategoryDataset dataset) {
    ParamChecks.nullNotPermitted(dataset, "dataset");
    if (dataset instanceof RangeInfo) {
        RangeInfo info = (RangeInfo) dataset;
        return new Double(info.getRangeLowerBound(true));
    }

    // hasn't implemented RangeInfo, so we'll have to iterate...
    else {
        double minimum = Double.POSITIVE_INFINITY;
        int seriesCount = dataset.getRowCount();
        int itemCount = dataset.getColumnCount();
        for (int series = 0; series < seriesCount; series++) {
            for (int item = 0; item < itemCount; item++) {
                Number value;
                if (dataset instanceof IntervalCategoryDataset) {
                    IntervalCategoryDataset icd
                            = (IntervalCategoryDataset) dataset;
                    value = icd.getStartValue(series, item);
                }
                else {
                    value = dataset.getValue(series, item);
                }
                if (value != null) {
                    minimum = Math.min(minimum, value.doubleValue());
                }
            }
        }
        if (minimum == Double.POSITIVE_INFINITY) {
            return null;
        }
        else {
            return new Double(minimum);
        }

    }

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

示例6: findRangeBounds

import org.jfree.data.RangeInfo; //导入依赖的package包/类
/**
 * Returns the range of values in the range for the dataset.
 *
 * @param dataset  the dataset ({@code null} not permitted).
 * @param includeInterval  a flag that determines whether or not the
 *                         y-interval is taken into account.
 *
 * @return The range (possibly {@code null}).
 */
public static Range findRangeBounds(CategoryDataset dataset,
        boolean includeInterval) {
    Args.nullNotPermitted(dataset, "dataset");
    Range result;
    if (dataset instanceof RangeInfo) {
        RangeInfo info = (RangeInfo) dataset;
        result = info.getRangeBounds(includeInterval);
    }
    else {
        result = iterateRangeBounds(dataset, includeInterval);
    }
    return result;
}
 
开发者ID:jfree,项目名称:jfreechart,代码行数:23,代码来源:DatasetUtils.java

示例7: findMinimumRangeValue

import org.jfree.data.RangeInfo; //导入依赖的package包/类
/**
 * Returns the minimum range value for the specified dataset.  This is
 * easy if the dataset implements the {@link RangeInfo} interface (a good
 * idea if there is an efficient way to determine the minimum 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 minimum value (possibly {@code null}).
 */
public static Number findMinimumRangeValue(CategoryDataset dataset) {
    Args.nullNotPermitted(dataset, "dataset");
    if (dataset instanceof RangeInfo) {
        RangeInfo info = (RangeInfo) dataset;
        return new Double(info.getRangeLowerBound(true));
    }

    // hasn't implemented RangeInfo, so we'll have to iterate...
    else {
        double minimum = Double.POSITIVE_INFINITY;
        int seriesCount = dataset.getRowCount();
        int itemCount = dataset.getColumnCount();
        for (int series = 0; series < seriesCount; series++) {
            for (int item = 0; item < itemCount; item++) {
                Number value;
                if (dataset instanceof IntervalCategoryDataset) {
                    IntervalCategoryDataset icd
                            = (IntervalCategoryDataset) dataset;
                    value = icd.getStartValue(series, item);
                }
                else {
                    value = dataset.getValue(series, item);
                }
                if (value != null) {
                    minimum = Math.min(minimum, value.doubleValue());
                }
            }
        }
        if (minimum == Double.POSITIVE_INFINITY) {
            return null;
        }
        else {
            return new Double(minimum);
        }

    }

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


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