001    /*
002    // $Id: //open/mondrian/src/main/mondrian/rolap/DelegatingMemberReader.java#16 $
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    // All Rights Reserved.
008    // You must accept the terms of that agreement to use this software.
009    //
010    // jhyde, Feb 26, 2003
011    */
012    package mondrian.rolap;
013    
014    import java.util.List;
015    
016    import mondrian.olap.Id;
017    import mondrian.rolap.TupleReader.MemberBuilder;
018    import mondrian.rolap.sql.TupleConstraint;
019    import mondrian.rolap.sql.MemberChildrenConstraint;
020    
021    /**
022     * A <code>DelegatingMemberReader</code> is a {@link MemberReader} which
023     * redirects all method calls to an underlying {@link MemberReader}.
024     *
025     * @author jhyde
026     * @since Feb 26, 2003
027     * @version $Id: //open/mondrian/src/main/mondrian/rolap/DelegatingMemberReader.java#16 $
028     */
029    class DelegatingMemberReader implements MemberReader {
030        protected final MemberReader memberReader;
031    
032        DelegatingMemberReader(MemberReader memberReader) {
033            this.memberReader = memberReader;
034        }
035    
036        public RolapMember substitute(RolapMember member) {
037            return memberReader.substitute(member);
038        }
039    
040        public RolapMember desubstitute(RolapMember member) {
041            return memberReader.desubstitute(member);
042        }
043    
044        public RolapMember getLeadMember(RolapMember member, int n) {
045            return memberReader.getLeadMember(member, n);
046        }
047    
048        public List<RolapMember> getMembersInLevel(
049            RolapLevel level,
050            int startOrdinal,
051            int endOrdinal)
052        {
053            return memberReader.getMembersInLevel(level, startOrdinal, endOrdinal);
054        }
055    
056        public void getMemberRange(
057            RolapLevel level,
058            RolapMember startMember,
059            RolapMember endMember,
060            List<RolapMember> list)
061        {
062            memberReader.getMemberRange(level, startMember, endMember, list);
063        }
064    
065        public int compare(
066            RolapMember m1,
067            RolapMember m2,
068            boolean siblingsAreEqual)
069        {
070            return memberReader.compare(m1, m2, siblingsAreEqual);
071        }
072    
073        public RolapHierarchy getHierarchy() {
074            return memberReader.getHierarchy();
075        }
076    
077        public boolean setCache(MemberCache cache) {
078            return memberReader.setCache(cache);
079        }
080    
081        public List<RolapMember> getMembers() {
082            return memberReader.getMembers();
083        }
084    
085        public List<RolapMember> getRootMembers() {
086            return memberReader.getRootMembers();
087        }
088    
089        public void getMemberChildren(
090            RolapMember parentMember,
091            List<RolapMember> children)
092        {
093            memberReader.getMemberChildren(parentMember, children);
094        }
095    
096        public void getMemberChildren(
097            List<RolapMember> parentMembers,
098            List<RolapMember> children)
099        {
100            memberReader.getMemberChildren(parentMembers, children);
101        }
102    
103        public int getMemberCount() {
104            return memberReader.getMemberCount();
105        }
106    
107        public RolapMember lookupMember(
108            List<Id.Segment> uniqueNameParts,
109            boolean failIfNotFound)
110        {
111            return memberReader.lookupMember(uniqueNameParts, failIfNotFound);
112        }
113    
114        public void getMemberChildren(
115            RolapMember member,
116            List<RolapMember> children,
117            MemberChildrenConstraint constraint)
118        {
119            memberReader.getMemberChildren(member, children, constraint);
120        }
121    
122        public void getMemberChildren(
123            List<RolapMember> parentMembers,
124            List<RolapMember> children,
125            MemberChildrenConstraint constraint)
126        {
127            memberReader.getMemberChildren(parentMembers, children, constraint);
128        }
129    
130        public List<RolapMember> getMembersInLevel(
131            RolapLevel level,
132            int startOrdinal,
133            int endOrdinal,
134            TupleConstraint constraint)
135        {
136            return memberReader.getMembersInLevel(
137                level, startOrdinal, endOrdinal, constraint);
138        }
139    
140        public int getLevelMemberCount(RolapLevel level) {
141            return memberReader.getLevelMemberCount(level);
142        }
143    
144        public MemberBuilder getMemberBuilder() {
145            return memberReader.getMemberBuilder();
146        }
147    
148        public RolapMember getDefaultMember() {
149            return memberReader.getDefaultMember();
150        }
151    
152        public RolapMember getMemberParent(RolapMember member) {
153            return memberReader.getMemberParent(member);
154        }
155    }
156    
157    // End DelegatingMemberReader.java