1 10 package mondrian.calc.impl; 11 12 import mondrian.olap.*; 13 import mondrian.olap.type.MemberType; 14 import mondrian.calc.impl.AbstractMemberCalc; 15 import mondrian.calc.DummyExp; 16 import mondrian.calc.Calc; 17 18 25 public class DimensionCurrentMemberCalc extends AbstractMemberCalc { 26 private final Dimension dimension; 27 28 public DimensionCurrentMemberCalc(Dimension dimension) { 29 super( 30 new DummyExp( 31 MemberType.forHierarchy(dimension.getHierarchy())), 32 new Calc[0]); 33 this.dimension = dimension; 34 } 35 36 public Member evaluateMember(Evaluator evaluator) { 37 return evaluator.getContext(dimension); 38 } 39 40 public boolean dependsOn(Dimension dimension) { 41 return dimension == this.dimension; 42 } 43 } 44 45 | Popular Tags |