Package mondrian.olap

Examples of mondrian.olap.Level


      if (hierarchyOrder != 0)
      {
        return hierarchyOrder;
      }

      Level level1 = o1.getLevel();
      Level level2 = o2.getLevel();
      int levelOrder = Integer.compare(level1.getDepth(), level2.getDepth());
      if (levelOrder != 0)
      {
        return levelOrder;
      }
      return o1.getLevel().getUniqueName().compareTo(o2.getLevel().getUniqueName());
View Full Code Here


        List<RolapMember> rootMembers = reader.getRootMembers();
        print(rootMembers);
        pw.println();

        Level[] levels = rootMembers.get(0).getHierarchy().getLevels();
        Level level = levels[levels.length > 1 ? 1 : 0];
        pw.print("Members at level " + level.getUniqueName() + " are ");
        List<RolapMember> members =
            reader.getMembersInLevel((RolapLevel)level, 0, Integer.MAX_VALUE);
        print(members);
        pw.println();
View Full Code Here

                compiler.compileLevel(call.getArg(1));
            return new AbstractMemberCalc(
                call, new Calc[] {memberCalc, levelCalc})
            {
                public Member evaluateMember(Evaluator evaluator) {
                    Level level = levelCalc.evaluateLevel(evaluator);
                    Member member = memberCalc.evaluateMember(evaluator);
                    int distance =
                        member.getLevel().getDepth() - level.getDepth();
                    return ancestor(evaluator, member, distance, level);
                }
            };
        } else {
            final IntegerCalc distanceCalc =
View Full Code Here

            super(exp, new Calc[] {levelCalc});
            this.levelCalc = levelCalc;
        }

        public Hierarchy evaluateHierarchy(Evaluator evaluator) {
            Level level = levelCalc.evaluateLevel(evaluator);
            return level.getHierarchy();
        }
View Full Code Here

    public Calc compileCall(ResolvedFunCall call, ExpCompiler compiler) {
        final LevelCalc levelCalc =
            compiler.compileLevel(call.getArg(0));
        return new AbstractMemberListCalc(call, new Calc[] {levelCalc}) {
            public List<Member> evaluateMemberList(Evaluator evaluator) {
                Level level = levelCalc.evaluateLevel(evaluator);
                return levelMembers(level, evaluator, false);
            }
        };
    }
View Full Code Here

    when( hierarchy.getName() ).thenReturn( hierarchyName );
    return hierarchy;
  }

  private Level mockLevel( String name ) {
    Level level = mock( Level.class );
    when( level.getName() ).thenReturn( LEVEL_NAME + name );
    return level;
  }
View Full Code Here

    when( dimension.getName() ).thenReturn( DIMENSION_NAME + name );
    return dimension;
  }

  private Member mockMember( String caption, String name ) {
    Level level = mockLevel( name );
    Dimension dimension = mockDimension( name );
    Hierarchy hierarchy = mockHierarchy( name, caption );

    Member member = mock( Member.class );
    when( member.getCaption() ).thenReturn( caption );
View Full Code Here

             } else {
                for (int j = 0; j < hierarchies.length; j++) {
                  mondrian.olap.Hierarchy aHierarchy =  hierarchies[j];
                  if (aHierarchy.getName().equalsIgnoreCase(dimName)) {
                    Level[] levels = aHierarchy.getLevels();
                    Level topLev = null;
                    Level bottomLev = null;
                    for(int k=0; k<levels.length; k++) {
                      Level level = levels[k];
                      if(level.getUniqueName().equals(topLevel)) {
                        topLev = level;
                      }
                      if(level.getUniqueName().equals(bottomLevel)) {
                        bottomLev = level;
                      }
                    }
                    Role.RollupPolicy rp = null;
                    if (rollupPolicy == null) {
View Full Code Here

  }
 
  private String getLevelValue(Member member, String levelName) {
    logger.debug("IN: Member is " + member.getUniqueName() + ", levelName is " + levelName);
    String toReturn = null;
    Level level = member.getLevel();
    logger.debug("Member level is " + level.getUniqueName());
    if (level.getUniqueName().equals(levelName)) {
      logger.debug("Member level matches input level name " + levelName + "!!");
      String uniqueName = member.getUniqueName();
      // The uniqueName is the name of the member retrieved by the column defined in "nameColumn" property of the level in the xml schema.
      // If the key value is required (retrieved by the column defined in "column" property), use the following code
      // TODO: test it!!!
View Full Code Here

    public Calc compileCall(ResolvedFunCall call, ExpCompiler compiler) {
        final LevelCalc levelCalc =
            compiler.compileLevel(call.getArg(0));
        return new AbstractListCalc(call, new Calc[] {levelCalc}) {
            public TupleList evaluateList(Evaluator evaluator) {
                Level level = levelCalc.evaluateLevel(evaluator);
                return levelMembers(level, evaluator, false);
            }
        };
    }
View Full Code Here

TOP

Related Classes of mondrian.olap.Level

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.