001    /*
002    // $Id: //open/mondrian/src/main/mondrian/olap/DelegatingSchemaReader.java#31 $
003    // This software is subject to the terms of the Common Public License
004    // Agreement, available at the following URL:
005    // http://www.opensource.org/licenses/cpl.html.
006    // Copyright (C) 2003-2008 Julian Hyde
007    // Copyright (C) 2004-2005 TONBELLER AG
008    // All Rights Reserved.
009    // You must accept the terms of that agreement to use this software.
010    //
011    // jhyde, Feb 26, 2003
012    */
013    package mondrian.olap;
014    
015    import mondrian.calc.Calc;
016    
017    import javax.sql.DataSource;
018    import java.util.List;
019    
020    /**
021     * <code>DelegatingSchemaReader</code> implements {@link SchemaReader} by
022     * delegating all methods to an underlying {@link SchemaReader}.
023     *
024     * It is a convenient base class if you want to override just a few of
025     * {@link SchemaReader}'s methods.
026     *
027     * @author jhyde
028     * @since Feb 26, 2003
029     * @version $Id: //open/mondrian/src/main/mondrian/olap/DelegatingSchemaReader.java#31 $
030     */
031    public abstract class DelegatingSchemaReader implements SchemaReader {
032        protected final SchemaReader schemaReader;
033    
034        /**
035         * Creates a DelegatingSchemaReader.
036         *
037         * @param schemaReader Parent reader to delegate unhandled calls to
038         */
039        protected DelegatingSchemaReader(SchemaReader schemaReader) {
040            this.schemaReader = schemaReader;
041        }
042    
043        public Role getRole() {
044            return schemaReader.getRole();
045        }
046    
047        public List<Member> getHierarchyRootMembers(Hierarchy hierarchy) {
048            return schemaReader.getHierarchyRootMembers(hierarchy);
049        }
050    
051        public Member getMemberParent(Member member) {
052            return schemaReader.getMemberParent(member);
053        }
054    
055        public Member substitute(Member member) {
056            return schemaReader.substitute(member);
057        }
058    
059        public List<Member> getMemberChildren(Member member) {
060            return schemaReader.getMemberChildren(member);
061        }
062    
063        public List<Member> getMemberChildren(List<Member> members) {
064            return schemaReader.getMemberChildren(members);
065        }
066    
067        public int getMemberDepth(Member member) {
068            return schemaReader.getMemberDepth(member);
069        }
070    
071        public final Member getMemberByUniqueName(
072            List<Id.Segment> uniqueNameParts,
073            boolean failIfNotFound)
074        {
075            return getMemberByUniqueName(
076                uniqueNameParts, failIfNotFound, MatchType.EXACT);
077        }
078    
079        public Member getMemberByUniqueName(
080                List<Id.Segment> uniqueNameParts,
081                boolean failIfNotFound,
082                MatchType matchType)
083        {
084            return schemaReader.getMemberByUniqueName(
085                    uniqueNameParts, failIfNotFound, matchType);
086        }
087    
088        public OlapElement lookupCompound(
089            OlapElement parent, List<Id.Segment> names,
090            boolean failIfNotFound, int category)
091        {
092            return lookupCompound(
093                parent, names, failIfNotFound, category, MatchType.EXACT);
094        }
095    
096        public OlapElement lookupCompound(
097            OlapElement parent, List<Id.Segment> names,
098            boolean failIfNotFound, int category, MatchType matchType)
099        {
100            return schemaReader.lookupCompound(
101                    parent, names, failIfNotFound, category, matchType);
102        }
103    
104        public Member getCalculatedMember(List<Id.Segment> nameParts) {
105            return schemaReader.getCalculatedMember(nameParts);
106        }
107    
108        public NamedSet getNamedSet(List<Id.Segment> nameParts) {
109            return schemaReader.getNamedSet(nameParts);
110        }
111    
112        public void getMemberRange(
113                Level level,
114                Member startMember,
115                Member endMember,
116                List<Member> list) {
117            schemaReader.getMemberRange(level, startMember, endMember, list);
118        }
119    
120        public Member getLeadMember(Member member, int n) {
121            return schemaReader.getLeadMember(member, n);
122        }
123    
124        public int compareMembersHierarchically(Member m1, Member m2) {
125            return schemaReader.compareMembersHierarchically(m1, m2);
126        }
127    
128        public OlapElement getElementChild(OlapElement parent, Id.Segment name) {
129            return getElementChild(parent, name, MatchType.EXACT);
130        }
131    
132        public OlapElement getElementChild(
133            OlapElement parent, Id.Segment name, MatchType matchType)
134        {
135            return schemaReader.getElementChild(parent, name, matchType);
136        }
137    
138        public List<Member> getLevelMembers(Level level, boolean includeCalculated) {
139            return schemaReader.getLevelMembers(level, includeCalculated);
140        }
141    
142        public List<Level> getHierarchyLevels(Hierarchy hierarchy) {
143            return schemaReader.getHierarchyLevels(hierarchy);
144        }
145    
146        public Member getHierarchyDefaultMember(Hierarchy hierarchy) {
147            return schemaReader.getHierarchyDefaultMember(hierarchy);
148        }
149    
150        public boolean isDrillable(Member member) {
151            return schemaReader.isDrillable(member);
152        }
153    
154        public boolean isVisible(Member member) {
155            return schemaReader.isVisible(member);
156        }
157    
158        public Cube[] getCubes() {
159            return schemaReader.getCubes();
160        }
161    
162        public List<Member> getCalculatedMembers(Hierarchy hierarchy) {
163            return schemaReader.getCalculatedMembers(hierarchy);
164        }
165    
166        public List<Member> getCalculatedMembers(Level level) {
167            return schemaReader.getCalculatedMembers(level);
168        }
169    
170        public List<Member> getCalculatedMembers() {
171            return schemaReader.getCalculatedMembers();
172        }
173    
174        public int getChildrenCountFromCache(Member member) {
175            return schemaReader.getChildrenCountFromCache(member);
176        }
177    
178        public int getLevelCardinality(
179            Level level, boolean approximate, boolean materialize)
180        {
181            return schemaReader.getLevelCardinality(
182                level, approximate, materialize);
183        }
184    
185        public List<Member> getLevelMembers(Level level, Evaluator context) {
186          return schemaReader.getLevelMembers(level, context);
187        }
188    
189        public List<Member> getMemberChildren(Member member, Evaluator context) {
190          return schemaReader.getMemberChildren(member, context);
191        }
192    
193        public List<Member> getMemberChildren(List<Member> members, Evaluator context) {
194          return schemaReader.getMemberChildren(members, context);
195        }
196    
197        public Member lookupMemberChildByName(Member member,Id.Segment memberName) {
198            return lookupMemberChildByName(member, memberName, MatchType.EXACT);
199        }
200    
201        public Member lookupMemberChildByName(
202            Member member, Id.Segment memberName, MatchType matchType)
203        {
204            return schemaReader.lookupMemberChildByName(
205                member, memberName, matchType);
206        }
207    
208        public NativeEvaluator getNativeSetEvaluator(
209                FunDef fun, Exp[] args, Evaluator evaluator, Calc calc) {
210            return schemaReader.getNativeSetEvaluator(fun, args, evaluator, calc);
211        }
212    
213        public Parameter getParameter(String name) {
214            return schemaReader.getParameter(name);
215        }
216    
217        public DataSource getDataSource() {
218            return schemaReader.getDataSource();
219        }
220    }
221    
222    // End DelegatingSchemaReader.java