KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > mondrian > olap > DelegatingSchemaReader


1 /*
2 // $Id: //open/mondrian/src/main/mondrian/olap/DelegatingSchemaReader.java#25 $
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) 2003-2006 Julian Hyde
7 // Copyright (C) 2004-2005 TONBELLER AG
8 // All Rights Reserved.
9 // You must accept the terms of that agreement to use this software.
10 //
11 // jhyde, Feb 26, 2003
12 */

13 package mondrian.olap;
14
15 import mondrian.calc.Calc;
16
17 import javax.sql.DataSource JavaDoc;
18 import java.util.List JavaDoc;
19
20 /**
21  * <code>DelegatingSchemaReader</code> implements {@link SchemaReader} by
22  * delegating all methods to an underlying {@link SchemaReader}.
23  *
24  * It is a convenient base class if you want to override just a few of
25  * {@link SchemaReader}'s methods.
26  *
27  * @author jhyde
28  * @since Feb 26, 2003
29  * @version $Id: //open/mondrian/src/main/mondrian/olap/DelegatingSchemaReader.java#25 $
30  */

31 public abstract class DelegatingSchemaReader implements SchemaReader {
32     protected final SchemaReader schemaReader;
33
34     DelegatingSchemaReader(SchemaReader schemaReader) {
35         this.schemaReader = schemaReader;
36     }
37
38     public Role getRole() {
39         return schemaReader.getRole();
40     }
41
42     public Member[] getHierarchyRootMembers(Hierarchy hierarchy) {
43         return schemaReader.getHierarchyRootMembers(hierarchy);
44     }
45
46     public Member getMemberParent(Member member) {
47         return schemaReader.getMemberParent(member);
48     }
49
50     public Member[] getMemberChildren(Member member) {
51         return schemaReader.getMemberChildren(member);
52     }
53
54     public Member[] getMemberChildren(Member[] members) {
55         return schemaReader.getMemberChildren(members);
56     }
57
58     public int getMemberDepth(Member member) {
59         return schemaReader.getMemberDepth(member);
60     }
61
62     public Member getMemberByUniqueName(
63         String JavaDoc[] uniqueNameParts,
64         boolean failIfNotFound)
65     {
66         return getMemberByUniqueName(
67             uniqueNameParts, failIfNotFound, MatchType.EXACT);
68     }
69
70     public Member getMemberByUniqueName(
71             String JavaDoc[] uniqueNameParts,
72             boolean failIfNotFound,
73             MatchType matchType)
74     {
75         return schemaReader.getMemberByUniqueName(
76                 uniqueNameParts, failIfNotFound, matchType);
77     }
78
79     public OlapElement lookupCompound(
80         OlapElement parent, String JavaDoc[] names,
81         boolean failIfNotFound, int category)
82     {
83         return lookupCompound(
84             parent, names, failIfNotFound, category, MatchType.EXACT);
85     }
86
87     public OlapElement lookupCompound(
88             OlapElement parent, String JavaDoc[] names,
89             boolean failIfNotFound, int category, MatchType matchType) {
90         return schemaReader.lookupCompound(
91                 parent, names, failIfNotFound, category, matchType);
92     }
93
94     public Member getCalculatedMember(String JavaDoc[] nameParts) {
95         return schemaReader.getCalculatedMember(nameParts);
96     }
97
98     public NamedSet getNamedSet(String JavaDoc[] nameParts) {
99         return schemaReader.getNamedSet(nameParts);
100     }
101
102     public void getMemberRange(
103             Level level,
104             Member startMember,
105             Member endMember,
106             List JavaDoc<Member> list) {
107         schemaReader.getMemberRange(level, startMember, endMember, list);
108     }
109
110     public Member getLeadMember(Member member, int n) {
111         return schemaReader.getLeadMember(member, n);
112     }
113
114     public int compareMembersHierarchically(Member m1, Member m2) {
115         return schemaReader.compareMembersHierarchically(m1, m2);
116     }
117
118     public OlapElement getElementChild(OlapElement parent, String JavaDoc name) {
119         return getElementChild(parent, name, MatchType.EXACT);
120     }
121
122     public OlapElement getElementChild(
123         OlapElement parent, String JavaDoc name, MatchType matchType)
124     {
125         return schemaReader.getElementChild(parent, name, matchType);
126     }
127
128     public Member[] getLevelMembers(Level level, boolean includeCalculated) {
129         return schemaReader.getLevelMembers(level, includeCalculated);
130     }
131
132     public Level[] getHierarchyLevels(Hierarchy hierarchy) {
133         return schemaReader.getHierarchyLevels(hierarchy);
134     }
135
136     public Member getHierarchyDefaultMember(Hierarchy hierarchy) {
137         return schemaReader.getHierarchyDefaultMember(hierarchy);
138     }
139
140     public boolean isDrillable(Member member) {
141         return schemaReader.isDrillable(member);
142     }
143
144     public boolean isVisible(Member member) {
145         return schemaReader.isVisible(member);
146     }
147
148     public Cube[] getCubes() {
149         return schemaReader.getCubes();
150     }
151
152     public List JavaDoc<Member> getCalculatedMembers(Hierarchy hierarchy) {
153         return schemaReader.getCalculatedMembers(hierarchy);
154     }
155
156     public List JavaDoc<Member> getCalculatedMembers(Level level) {
157         return schemaReader.getCalculatedMembers(level);
158     }
159
160     public List JavaDoc<Member> getCalculatedMembers() {
161         return schemaReader.getCalculatedMembers();
162     }
163
164     public int getChildrenCountFromCache(Member member) {
165         return schemaReader.getChildrenCountFromCache(member);
166     }
167
168     public int getLevelCardinality(
169         Level level, boolean approximate, boolean materialize)
170     {
171         return schemaReader.getLevelCardinality(
172             level, approximate, materialize);
173     }
174
175     public Member[] getLevelMembers(Level level, Evaluator context) {
176       return schemaReader.getLevelMembers(level, context);
177     }
178
179     public Member[] getMemberChildren(Member member, Evaluator context) {
180       return schemaReader.getMemberChildren(member, context);
181     }
182
183     public Member[] getMemberChildren(Member[] members, Evaluator context) {
184       return schemaReader.getMemberChildren(members, context);
185     }
186
187     public Member lookupMemberChildByName(Member member, String JavaDoc memberName) {
188         return lookupMemberChildByName(member, memberName, MatchType.EXACT);
189     }
190
191     public Member lookupMemberChildByName(
192         Member member, String JavaDoc memberName, MatchType matchType)
193     {
194         return schemaReader.lookupMemberChildByName(
195             member, memberName, matchType);
196     }
197
198     public NativeEvaluator getNativeSetEvaluator(
199             FunDef fun, Exp[] args, Evaluator evaluator, Calc calc) {
200         return schemaReader.getNativeSetEvaluator(fun, args, evaluator, calc);
201     }
202
203     public Parameter getParameter(String JavaDoc name) {
204         return schemaReader.getParameter(name);
205     }
206
207     public DataSource JavaDoc getDataSource() {
208         return schemaReader.getDataSource();
209     }
210 }
211
212 // End DelegatingSchemaReader.java
213
Popular Tags