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


Java RolapMeasure类代码示例

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


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

示例1: generateMondrianDef

import mondrian.rolap.RolapMeasure; //导入依赖的package包/类
private MondrianDef.AggName generateMondrianDef(Schema schema, Output output) {
    
    AggregateTableOutput tableOutput = (AggregateTableOutput)output;

    MondrianDef.AggName aggName = new MondrianDef.AggName();
    aggName.name = tableOutput.getTableName();
            
    List<MondrianDef.AggMeasure> measures = new ArrayList<MondrianDef.AggMeasure>();
    List<MondrianDef.AggLevel> levels = new ArrayList<MondrianDef.AggLevel>();
    
    int i = -1;
    
    for (AggregateTableOutput.ColumnOutput column : tableOutput.getColumnOutputs()) {
        ++i;
        String columnName = column.getName();
        Attribute attribute = column.getAttribute();
        if (attribute instanceof Measure) {
            Measure measure = (Measure)attribute;
            RolapStar.Measure rolapStarMeasure = ((MondrianMeasure)measure).getRolapStarMeasure();

            if (rolapStarMeasure.getName().equals("fact_count")) {
                // add as fact count
                MondrianDef.AggFactCount aggFactCount = new MondrianDef.AggFactCount();
                aggFactCount.column = columnName;
                aggName.factcount = aggFactCount;
            } else {
                // add as regular measure
                RolapMeasure rolapMeasure = findRolapMeasure(schema, measure);
                MondrianDef.AggMeasure measureDef = new MondrianDef.AggMeasure();
                measureDef.name = rolapMeasure.getUniqueName();
                measureDef.column = columnName;
                measures.add(measureDef);
            }
            
        } else {
            Level level = findLevel(schema, attribute);
            RolapCubeLevel rolapLevel = ((MondrianLevel)level).getRolapCubeLevel();
            
            MondrianDef.AggLevel levelDef = new MondrianDef.AggLevel();
            levelDef.name = rolapLevel.getUniqueName();
            levelDef.column = columnName;
            levels.add(levelDef);
        }
    }
    
    aggName.levels = (MondrianDef.AggLevel[])levels.toArray(new MondrianDef.AggLevel[0]);
    aggName.measures = (MondrianDef.AggMeasure[])measures.toArray(new MondrianDef.AggMeasure[0]);
    
    return aggName;
}
 
开发者ID:pentaho,项目名称:pentaho-aggdesigner,代码行数:51,代码来源:MondrianSchemaGenerator.java


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