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


Java KeyToGroupMap.getGroupCount方法代码示例

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


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

示例1: findStackedRangeExtent

import org.jfree.data.KeyToGroupMap; //导入方法依赖的package包/类
/**
 * Returns the minimum and maximum values for the dataset's range (as in domain/range),
 * assuming that the series in one category are stacked.
 *
 * @param dataset  the dataset.
 * @param map  a structure that maps series to groups.
 *
 * @return the value range.
 */
public static Range findStackedRangeExtent(CategoryDataset dataset,
                                           KeyToGroupMap map) {

    Range result = null;
    if (dataset != null) {
        
        // create an array holding the group indices...
        int[] groupIndex = new int[dataset.getRowCount()];
        for (int i = 0; i < dataset.getRowCount(); i++) {
            groupIndex[i] = map.getGroupIndex(map.getGroup(dataset.getRowKey(i)));   
        }
        
        // minimum and maximum for each group...
        int groupCount = map.getGroupCount();
        double[] minimum = new double[groupCount];
        double[] maximum = new double[groupCount];
        
        int categoryCount = dataset.getColumnCount();
        for (int item = 0; item < categoryCount; item++) {
            double[] positive = new double[groupCount];
            double[] negative = new double[groupCount];
            int seriesCount = dataset.getRowCount();
            for (int series = 0; series < seriesCount; series++) {
                Number number = dataset.getValue(series, item);
                if (number != null) {
                    double value = number.doubleValue();
                    if (value > 0.0) {
                        positive[groupIndex[series]] = positive[groupIndex[series]] + value;
                    }
                    if (value < 0.0) {
                        negative[groupIndex[series]] = negative[groupIndex[series]] + value;
                        // '+', remember value is negative
                    }
                }
            }
            for (int g = 0; g < groupCount; g++) {
                minimum[g] = Math.min(minimum[g], negative[g]);
                maximum[g] = Math.max(maximum[g], positive[g]);
            }
        }
        for (int j = 0; j < groupCount; j++) {
            result = Range.combine(result, new Range(minimum[j], maximum[j]));
        }
    }
    return result;

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

示例2: findStackedRangeBounds

import org.jfree.data.KeyToGroupMap; //导入方法依赖的package包/类
/**
 * Returns the minimum and maximum values for the dataset's range 
 * (y-values), assuming that the series in one category are stacked.
 *
 * @param dataset  the dataset.
 * @param map  a structure that maps series to groups.
 *
 * @return The value range (<code>null</code> if the dataset contains no 
 *         values).
 */
public static Range findStackedRangeBounds(CategoryDataset dataset,
                                           KeyToGroupMap map) {

    Range result = null;
    if (dataset != null) {
        
        // create an array holding the group indices...
        int[] groupIndex = new int[dataset.getRowCount()];
        for (int i = 0; i < dataset.getRowCount(); i++) {
            groupIndex[i] = map.getGroupIndex(
                map.getGroup(dataset.getRowKey(i))
            );   
        }
        
        // minimum and maximum for each group...
        int groupCount = map.getGroupCount();
        double[] minimum = new double[groupCount];
        double[] maximum = new double[groupCount];
        
        int categoryCount = dataset.getColumnCount();
        for (int item = 0; item < categoryCount; item++) {
            double[] positive = new double[groupCount];
            double[] negative = new double[groupCount];
            int seriesCount = dataset.getRowCount();
            for (int series = 0; series < seriesCount; series++) {
                Number number = dataset.getValue(series, item);
                if (number != null) {
                    double value = number.doubleValue();
                    if (value > 0.0) {
                        positive[groupIndex[series]] 
                             = positive[groupIndex[series]] + value;
                    }
                    if (value < 0.0) {
                        negative[groupIndex[series]] 
                             = negative[groupIndex[series]] + value;
                             // '+', remember value is negative
                    }
                }
            }
            for (int g = 0; g < groupCount; g++) {
                minimum[g] = Math.min(minimum[g], negative[g]);
                maximum[g] = Math.max(maximum[g], positive[g]);
            }
        }
        for (int j = 0; j < groupCount; j++) {
            result = Range.combine(
                result, new Range(minimum[j], maximum[j])
            );
        }
    }
    return result;

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

示例3: findStackedRangeBounds

import org.jfree.data.KeyToGroupMap; //导入方法依赖的package包/类
/**
 * Returns the minimum and maximum values for the dataset's range
 * (y-values), assuming that the series in one category are stacked.
 *
 * @param dataset  the dataset.
 * @param map  a structure that maps series to groups.
 *
 * @return The value range (<code>null</code> if the dataset contains no
 *         values).
 */
public static Range findStackedRangeBounds(CategoryDataset dataset,
        KeyToGroupMap map) {
    ParamChecks.nullNotPermitted(dataset, "dataset");
    boolean hasValidData = false;
    Range result = null;

    // create an array holding the group indices for each series...
    int[] groupIndex = new int[dataset.getRowCount()];
    for (int i = 0; i < dataset.getRowCount(); i++) {
        groupIndex[i] = map.getGroupIndex(map.getGroup(
                dataset.getRowKey(i)));
    }

    // minimum and maximum for each group...
    int groupCount = map.getGroupCount();
    double[] minimum = new double[groupCount];
    double[] maximum = new double[groupCount];

    int categoryCount = dataset.getColumnCount();
    for (int item = 0; item < categoryCount; item++) {
        double[] positive = new double[groupCount];
        double[] negative = new double[groupCount];
        int seriesCount = dataset.getRowCount();
        for (int series = 0; series < seriesCount; series++) {
            Number number = dataset.getValue(series, item);
            if (number != null) {
                hasValidData = true;
                double value = number.doubleValue();
                if (value > 0.0) {
                    positive[groupIndex[series]]
                             = positive[groupIndex[series]] + value;
                }
                if (value < 0.0) {
                    negative[groupIndex[series]]
                             = negative[groupIndex[series]] + value;
                             // '+', remember value is negative
                }
            }
        }
        for (int g = 0; g < groupCount; g++) {
            minimum[g] = Math.min(minimum[g], negative[g]);
            maximum[g] = Math.max(maximum[g], positive[g]);
        }
    }
    if (hasValidData) {
        for (int j = 0; j < groupCount; j++) {
            result = Range.combine(result, new Range(minimum[j],
                    maximum[j]));
        }
    }
    return result;
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:63,代码来源:DatasetUtilities.java

示例4: findStackedRangeBounds

import org.jfree.data.KeyToGroupMap; //导入方法依赖的package包/类
/**
 * Returns the minimum and maximum values for the dataset's range
 * (y-values), assuming that the series in one category are stacked.
 *
 * @param dataset  the dataset.
 * @param map  a structure that maps series to groups.
 *
 * @return The value range ({@code null} if the dataset contains no
 *         values).
 */
public static Range findStackedRangeBounds(CategoryDataset dataset,
        KeyToGroupMap map) {
    Args.nullNotPermitted(dataset, "dataset");
    boolean hasValidData = false;
    Range result = null;

    // create an array holding the group indices for each series...
    int[] groupIndex = new int[dataset.getRowCount()];
    for (int i = 0; i < dataset.getRowCount(); i++) {
        groupIndex[i] = map.getGroupIndex(map.getGroup(
                dataset.getRowKey(i)));
    }

    // minimum and maximum for each group...
    int groupCount = map.getGroupCount();
    double[] minimum = new double[groupCount];
    double[] maximum = new double[groupCount];

    int categoryCount = dataset.getColumnCount();
    for (int item = 0; item < categoryCount; item++) {
        double[] positive = new double[groupCount];
        double[] negative = new double[groupCount];
        int seriesCount = dataset.getRowCount();
        for (int series = 0; series < seriesCount; series++) {
            Number number = dataset.getValue(series, item);
            if (number != null) {
                hasValidData = true;
                double value = number.doubleValue();
                if (value > 0.0) {
                    positive[groupIndex[series]]
                             = positive[groupIndex[series]] + value;
                }
                if (value < 0.0) {
                    negative[groupIndex[series]]
                             = negative[groupIndex[series]] + value;
                             // '+', remember value is negative
                }
            }
        }
        for (int g = 0; g < groupCount; g++) {
            minimum[g] = Math.min(minimum[g], negative[g]);
            maximum[g] = Math.max(maximum[g], positive[g]);
        }
    }
    if (hasValidData) {
        for (int j = 0; j < groupCount; j++) {
            result = Range.combine(result, new Range(minimum[j],
                    maximum[j]));
        }
    }
    return result;
}
 
开发者ID:jfree,项目名称:jfreechart,代码行数:63,代码来源:DatasetUtils.java

示例5: findStackedRangeBounds

import org.jfree.data.KeyToGroupMap; //导入方法依赖的package包/类
/**
 * Returns the minimum and maximum values for the dataset's range
 * (y-values), assuming that the series in one category are stacked.
 *
 * @param dataset  the dataset.
 * @param map  a structure that maps series to groups.
 *
 * @return The value range (<code>null</code> if the dataset contains no
 *         values).
 */
public static Range findStackedRangeBounds(CategoryDataset dataset,
                                           KeyToGroupMap map) {

    Range result = null;
    if (dataset != null) {

        // create an array holding the group indices...
        int[] groupIndex = new int[dataset.getRowCount()];
        for (int i = 0; i < dataset.getRowCount(); i++) {
            groupIndex[i] = map.getGroupIndex(
                map.getGroup(dataset.getRowKey(i))
            );
        }

        // minimum and maximum for each group...
        int groupCount = map.getGroupCount();
        double[] minimum = new double[groupCount];
        double[] maximum = new double[groupCount];

        int categoryCount = dataset.getColumnCount();
        for (int item = 0; item < categoryCount; item++) {
            double[] positive = new double[groupCount];
            double[] negative = new double[groupCount];
            int seriesCount = dataset.getRowCount();
            for (int series = 0; series < seriesCount; series++) {
                Number number = dataset.getValue(series, item);
                if (number != null) {
                    double value = number.doubleValue();
                    if (value > 0.0) {
                        positive[groupIndex[series]]
                             = positive[groupIndex[series]] + value;
                    }
                    if (value < 0.0) {
                        negative[groupIndex[series]]
                             = negative[groupIndex[series]] + value;
                             // '+', remember value is negative
                    }
                }
            }
            for (int g = 0; g < groupCount; g++) {
                minimum[g] = Math.min(minimum[g], negative[g]);
                maximum[g] = Math.max(maximum[g], positive[g]);
            }
        }
        for (int j = 0; j < groupCount; j++) {
            result = Range.combine(
                result, new Range(minimum[j], maximum[j])
            );
        }
    }
    return result;

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

示例6: findStackedRangeBounds

import org.jfree.data.KeyToGroupMap; //导入方法依赖的package包/类
/**
 * Returns the minimum and maximum values for the dataset's range
 * (y-values), assuming that the series in one category are stacked.
 *
 * @param dataset  the dataset.
 * @param map  a structure that maps series to groups.
 *
 * @return The value range (<code>null</code> if the dataset contains no
 *         values).
 */
public static Range findStackedRangeBounds(CategoryDataset dataset,
                                           KeyToGroupMap map) {
    if (dataset == null) {
        throw new IllegalArgumentException("Null 'dataset' argument.");
    }
    boolean hasValidData = false;
    Range result = null;

    // create an array holding the group indices for each series...
    int[] groupIndex = new int[dataset.getRowCount()];
    for (int i = 0; i < dataset.getRowCount(); i++) {
        groupIndex[i] = map.getGroupIndex(map.getGroup(
                dataset.getRowKey(i)));
    }

    // minimum and maximum for each group...
    int groupCount = map.getGroupCount();
    double[] minimum = new double[groupCount];
    double[] maximum = new double[groupCount];

    int categoryCount = dataset.getColumnCount();
    for (int item = 0; item < categoryCount; item++) {
        double[] positive = new double[groupCount];
        double[] negative = new double[groupCount];
        int seriesCount = dataset.getRowCount();
        for (int series = 0; series < seriesCount; series++) {
            Number number = dataset.getValue(series, item);
            if (number != null) {
                hasValidData = true;
                double value = number.doubleValue();
                if (value > 0.0) {
                    positive[groupIndex[series]]
                             = positive[groupIndex[series]] + value;
                }
                if (value < 0.0) {
                    negative[groupIndex[series]]
                             = negative[groupIndex[series]] + value;
                             // '+', remember value is negative
                }
            }
        }
        for (int g = 0; g < groupCount; g++) {
            minimum[g] = Math.min(minimum[g], negative[g]);
            maximum[g] = Math.max(maximum[g], positive[g]);
        }
    }
    if (hasValidData) {
        for (int j = 0; j < groupCount; j++) {
            result = Range.combine(result, new Range(minimum[j],
                    maximum[j]));
        }
    }
    return result;
}
 
开发者ID:lulab,项目名称:PI,代码行数:65,代码来源:DatasetUtilities.java


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