KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > mondrian > rolap > RolapVirtualCubeMeasure


1 /*
2 // $Id: //open/mondrian/src/main/mondrian/rolap/RolapVirtualCubeMeasure.java#2 $
3 // This software is subject to the terms of the Common Public License
4 // Agreement, available at the following URL:
5 // http://www.opensource.org/licenses/cpl.html.
6 // Copyright (C) 2006-2006 Julian Hyde
7 // All Rights Reserved.
8 // You must accept the terms of that agreement to use this software.
9 */

10 package mondrian.rolap;
11
12 import mondrian.olap.MondrianDef;
13 import mondrian.olap.CellFormatter;
14
15 /**
16  * Measure which is defined in a virtual cube, and based on a stored measure
17  * in one of the virtual cube's base cubes.
18  *
19  * @author jhyde
20  * @version $Id: //open/mondrian/src/main/mondrian/rolap/RolapVirtualCubeMeasure.java#2 $
21  * @since Aug 18, 2006
22  */

23 public class RolapVirtualCubeMeasure
24     extends RolapMember
25     implements RolapStoredMeasure
26 {
27     /**
28      * The measure in the underlying cube.
29      */

30     private final RolapStoredMeasure cubeMeasure;
31
32     public RolapVirtualCubeMeasure(
33         RolapMember parentMember,
34         RolapLevel level,
35         RolapStoredMeasure cubeMeasure)
36     {
37         super(parentMember, level, cubeMeasure.getName());
38         this.cubeMeasure = cubeMeasure;
39     }
40
41     public Object JavaDoc getPropertyValue(String JavaDoc propertyName, boolean matchCase) {
42         // Look first in this member (against the virtual cube), then
43
// fallback on the base measure.
44
// This allows, for instance, a measure to be invisible in a virtual
45
// cube but visible in its base cube.
46
Object JavaDoc value = super.getPropertyValue(propertyName, matchCase);
47         if (value == null) {
48             value = cubeMeasure.getPropertyValue(propertyName, matchCase);
49         }
50         return value;
51     }
52
53     public RolapCube getCube() {
54         return cubeMeasure.getCube();
55     }
56
57     public Object JavaDoc getStarMeasure() {
58         return cubeMeasure.getStarMeasure();
59     }
60
61     public MondrianDef.Expression getMondrianDefExpression() {
62         return cubeMeasure.getMondrianDefExpression();
63     }
64
65     public RolapAggregator getAggregator() {
66         return cubeMeasure.getAggregator();
67     }
68
69     public CellFormatter getFormatter() {
70         return cubeMeasure.getFormatter();
71     }
72 }
73
74 // End RolapVirtualCubeMeasure.java
75
Popular Tags