mondrian.rolap
Interface MemberReader

All Superinterfaces:
MemberSource
All Known Subinterfaces:
RolapCubeHierarchy.RolapCubeHierarchyMemberReader
All Known Implementing Classes:
CacheMemberReader, DelegatingMemberReader, NoCacheMemberReader, RestrictedMemberReader, RolapCubeHierarchy.CacheRolapCubeHierarchyMemberReader, RolapCubeHierarchy.NoCacheRolapCubeHierarchyMemberReader, RolapCubeHierarchy.RolapCubeSqlMemberSource, SmartMemberReader, SqlMemberSource, SubstitutingMemberReader

interface MemberReader
extends MemberSource

A MemberReader implements common operations to retrieve members from a hierarchy.

MemberReader is an extension of MemberSource, which implements only the very basic operations. CacheMemberReader is an adapter which converts a MemberSource into a MemberReader and does caching too.

Since:
10 August, 2001
Author:
jhyde
 

Method Summary
 int compare(RolapMember m1, RolapMember m2, boolean siblingsAreEqual)
          Compares two members according to their order in a prefix ordered traversal.
 RolapMember desubstitute(RolapMember member)
          Returns the member which was substituted.
 RolapMember getDefaultMember()
           
 RolapMember getLeadMember(RolapMember member, int n)
          Returns the member n after member in the same level (or before, if n is negative).
 int getLevelMemberCount(RolapLevel level)
          Returns the number of members in this level.
 TupleReader.MemberBuilder getMemberBuilder()
           
 void getMemberChildren(List<RolapMember> parentMembers, List<RolapMember> children, MemberChildrenConstraint constraint)
          Populates a list of the children of a given set of Members, optionally applying a constraint.
 void getMemberChildren(RolapMember member, List<RolapMember> children, MemberChildrenConstraint constraint)
          Populates a list of the children of a Member, optionally applying a constraint.
 RolapMember getMemberParent(RolapMember member)
           
 void getMemberRange(RolapLevel level, RolapMember startMember, RolapMember endMember, List<RolapMember> list)
          Writes all members between startMember and endMember into list.
 List<RolapMember> getMembersInLevel(RolapLevel level, int startOrdinal, int endOrdinal)
          Returns all of the members in level whose ordinal lies between startOrdinal and endOrdinal.
 List<RolapMember> getMembersInLevel(RolapLevel level, int startOrdinal, int endOrdinal, TupleConstraint constraint)
          Returns the members in the given Level, optionally between a range of ordinals and applying a constraint.
 RolapMember substitute(RolapMember member)
          Substitutes a given member.
 
Methods inherited from interface mondrian.rolap.MemberSource
getHierarchy, getMemberChildren, getMemberChildren, getMemberCount, getMembers, getRootMembers, lookupMember, setCache
 

Method Detail

getLeadMember

RolapMember getLeadMember(RolapMember member,
                          int n)
Returns the member n after member in the same level (or before, if n is negative). Returns Hierarchy.getNullMember() if we run off the beginning or end of the level.


getMembersInLevel

List<RolapMember> getMembersInLevel(RolapLevel level,
                                    int startOrdinal,
                                    int endOrdinal)
Returns all of the members in level whose ordinal lies between startOrdinal and endOrdinal.

If this object supports cache-writeback, also writes these members to the cache.

Returns:
List of RolapMember

getMemberRange

void getMemberRange(RolapLevel level,
                    RolapMember startMember,
                    RolapMember endMember,
                    List<RolapMember> list)
Writes all members between startMember and endMember into list.


compare

int compare(RolapMember m1,
            RolapMember m2,
            boolean siblingsAreEqual)
Compares two members according to their order in a prefix ordered traversal. If siblingsAreEqual, then two members with the same parent will compare equal.

Returns:
less than zero if m1 occurs before m2, greater than zero if m1 occurs after m2, zero if m1 is equal to m2, or if siblingsAreEqual and m1 and m2 have the same parent

getMemberChildren

void getMemberChildren(RolapMember member,
                       List<RolapMember> children,
                       MemberChildrenConstraint constraint)
Populates a list of the children of a Member, optionally applying a constraint.

Parameters:
member - Members whose children to find
children - List to populate with members
constraint - Constraint

getMemberChildren

void getMemberChildren(List<RolapMember> parentMembers,
                       List<RolapMember> children,
                       MemberChildrenConstraint constraint)
Populates a list of the children of a given set of Members, optionally applying a constraint.

Parameters:
parentMembers - List of members whose children to find
children - List to populate with members
constraint - Constraint

getMembersInLevel

List<RolapMember> getMembersInLevel(RolapLevel level,
                                    int startOrdinal,
                                    int endOrdinal,
                                    TupleConstraint constraint)
Returns the members in the given Level, optionally between a range of ordinals and applying a constraint.

Parameters:
level - Level
startOrdinal - Ordinal of first member to retrieve
endOrdinal - Ordinal of last member to upper bound
constraint - Constraint
Returns:
list of members

getLevelMemberCount

int getLevelMemberCount(RolapLevel level)
Returns the number of members in this level.

Parameters:
level - Level
Returns:
number of members in level

getMemberBuilder

TupleReader.MemberBuilder getMemberBuilder()

getDefaultMember

RolapMember getDefaultMember()

getMemberParent

RolapMember getMemberParent(RolapMember member)

substitute

RolapMember substitute(RolapMember member)
Substitutes a given member. If member is null, returns null.

This method is called whenever a member is returned from the wrapped member reader and is to be returned to the caller. You could say that it translates 'to caller space'.

Parameters:
member - Member
Returns:
Substitute member

desubstitute

RolapMember desubstitute(RolapMember member)
Returns the member which was substituted. If member is null, returns null.

This method is called whenever the caller passes a member into a method and needs to be passed to a method on the wrapped member reader. You could say that it translates 'from caller space'.

Parameters:
member - Member
Returns:
Internal member

SourceForge.net_Logo