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


Java Result.getCell方法代码示例

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


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

示例1: testCalcMemberWithNonEmptyCrossJoin

import mondrian.olap.Result; //导入方法依赖的package包/类
/**
 * Make sure that the Crossjoin in [Measures].[CustomerCount]
 * is not evaluated in NON EMPTY context.
 */
public void testCalcMemberWithNonEmptyCrossJoin() {
    TestContext.instance().flushSchemaCache();
    Result result = executeQuery(
            "with member [Measures].[CustomerCount] as \n"
            + "'Count(CrossJoin({[Product].[All Products]}, [Customers].[Name].Members))'\n"
            + "select \n"
            + "NON EMPTY{[Measures].[CustomerCount]} ON columns,\n"
            + "NON EMPTY{[Product].[All Products]} ON rows\n"
            + "from [Sales]\n"
            + "where ([Store].[All Stores].[USA].[CA].[San Francisco].[Store 14], [Time].[1997].[Q1].[1])");
    Cell c = result.getCell(new int[] {0, 0});
    // we expect 10281 customers, although there are only 20 non-empty ones
    // @see #testLevelMembers
    assertEquals("10,281", c.getFormattedValue());
}
 
开发者ID:Twixer,项目名称:mondrian-3.1.5,代码行数:20,代码来源:NonEmptyTest.java

示例2: checkDrillThroughSql

import mondrian.olap.Result; //导入方法依赖的package包/类
private void checkDrillThroughSql(
    Result result,
    int row,
    boolean extendedContext,
    String expectedMember,
    String expectedCell,
    String expectedSql,
    int expectedRows) throws Exception
{
    final Member empMember =
        result.getAxes()[1].getPositions().get(row).get(0);
    assertEquals(expectedMember, empMember.getUniqueName());
    // drill through member
    final Cell cell = result.getCell(new int[]{0, row});
    assertEquals(expectedCell, cell.getFormattedValue());
    String sql = cell.getDrillThroughSQL(extendedContext);

    getTestContext().assertSqlEquals(expectedSql, sql, expectedRows);
}
 
开发者ID:Twixer,项目名称:mondrian-3.1.5,代码行数:20,代码来源:ParentChildHierarchyTest.java

示例3: outputFlattenedRecurse

import mondrian.olap.Result; //导入方法依赖的package包/类
private static void outputFlattenedRecurse(
    Result result,
    List<List<Object>> rows,
    List<Object> rowValues,
    int[] coords,
    int axisOrdinal)
{
    final Axis[] axes = result.getAxes();
    if (axisOrdinal == axes.length) {
        final Cell cell = result.getCell(coords);
        // Output the raw (unformatted) value of the cell.
        // NOTE: We could output other properties of the cell here, such as its
        // formatted value, too.
        rowValues.add(cell.getValue());

        // Add a copy of the completed row to the list of rows.
        rows.add(new ArrayList<Object>(rowValues));
    } else {
        final Axis axis = axes[axisOrdinal];
        int k = -1;
        int saveLength = rowValues.size();
        for (Position position : axis.getPositions()) {
            coords[axisOrdinal] = ++k;
            for (Member member : position) {
                rowValues.add(member.getUniqueName());
            }
            outputFlattenedRecurse(
                result, rows, rowValues, coords, axisOrdinal + 1);
            while (rowValues.size() > saveLength) {
                rowValues.remove(rowValues.size() - 1);
            }
        }
    }
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:35,代码来源:MondrianHelper.java

示例4: outputFlattenedRecurse

import mondrian.olap.Result; //导入方法依赖的package包/类
private static void outputFlattenedRecurse( Result result, List<List<Object>> rows, List<Object> rowValues,
  int[] coords, int axisOrdinal ) {
  final Axis[] axes = result.getAxes();
  if ( axisOrdinal == axes.length ) {
    final Cell cell = result.getCell( coords );
    // Output the raw (unformatted) value of the cell.
    // NOTE: We could output other properties of the cell here, such as its
    // formatted value, too.
    rowValues.add( cell.getValue() );

    // Add a copy of the completed row to the list of rows.
    rows.add( new ArrayList<>( rowValues ) );
  } else {
    final Axis axis = axes[axisOrdinal];
    int k = -1;
    int saveLength = rowValues.size();
    for ( Position position : axis.getPositions() ) {
      coords[axisOrdinal] = ++k;
      for ( Member member : position ) {
        rowValues.add( member.getUniqueName() );
      }
      outputFlattenedRecurse( result, rows, rowValues, coords, axisOrdinal + 1 );
      while ( rowValues.size() > saveLength ) {
        rowValues.remove( rowValues.size() - 1 );
      }
    }
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:29,代码来源:MondrianHelper.java

示例5: testPropertyCaseSensitivity

import mondrian.olap.Result; //导入方法依赖的package包/类
/**
 * Tests that property names are case sensitive iff the
 * "mondrian.olap.case.sensitive" property is set.
 *
 * <p>The test does not alter this property: for testing coverage, we assume
 * that you run the test once with mondrian.olap.case.sensitive=true,
 * and once with mondrian.olap.case.sensitive=false.
 */
public void testPropertyCaseSensitivity() {
    boolean caseSensitive = props.CaseSensitive.get();

    // A user-defined property of a member.
    assertExprReturns(
        "[Store].[USA].[CA].[Beverly Hills].[Store 6].Properties(\"Store Type\")",
        "Gourmet Supermarket");

    if (caseSensitive) {
        assertExprThrows(
            "[Store].[USA].[CA].[Beverly Hills].[Store 6].Properties(\"store tYpe\")",
            "Property 'store tYpe' is not valid for member '[Store].[All Stores].[USA].[CA].[Beverly Hills].[Store 6]'");
    } else {
        assertExprReturns(
            "[Store].[USA].[CA].[Beverly Hills].[Store 6].Properties(\"store tYpe\")",
            "Gourmet Supermarket");
    }

    // A builtin property of a member.
    assertExprReturns(
        "[Store].[USA].[CA].[Beverly Hills].[Store 6].Properties(\"LEVEL_NUMBER\")",
        "4");
    if (caseSensitive) {
        assertExprThrows(
            "[Store].[USA].[CA].[Beverly Hills].[Store 6].Properties(\"Level_Number\")",
            "Property 'store tYpe' is not valid for member '[Store].[All Stores].[USA].[CA].[Beverly Hills].[Store 6]'");
    } else {
        assertExprReturns(
            "[Store].[USA].[CA].[Beverly Hills].[Store 6].Properties(\"Level_Number\")",
            "4");
    }

    // Cell properties.
    Result result = executeQuery(
        "select {[Measures].[Unit Sales],[Measures].[Store Sales]} on columns,\n"
        + " {[Gender].[M]} on rows\n"
        + "from Sales");
    Cell cell = result.getCell(new int[]{0, 0});
    assertEquals("135,215", cell.getPropertyValue("FORMATTED_VALUE"));
    if (caseSensitive) {
        assertNull(cell.getPropertyValue("Formatted_Value"));
    } else {
        assertEquals("135,215", cell.getPropertyValue("Formatted_Value"));
    }
}
 
开发者ID:Twixer,项目名称:mondrian-3.1.5,代码行数:54,代码来源:CompatibilityTest.java


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