本文整理汇总了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;
}