Class ArrayMemberSource
- java.lang.Object
-
- mondrian.rolap.ArrayMemberSource
-
- All Implemented Interfaces:
MemberSource
- Direct Known Subclasses:
MeasureMemberSource
abstract class ArrayMemberSource extends Object implements MemberSource
ArrayMemberSourceimplements a flat, static hierarchy. There is no root member, and all members are siblings.- Since:
- 22 December, 2001
- Author:
- jhyde
-
-
Field Summary
Fields Modifier and Type Field Description protected RolapHierarchyhierarchyprotected List<RolapMember>members
-
Constructor Summary
Constructors Constructor Description ArrayMemberSource(RolapHierarchy hierarchy, List<RolapMember> members)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RolapHierarchygetHierarchy()Returns the hierarchy that this source is reading for.voidgetMemberChildren(List<RolapMember> parentMembers, List<RolapMember> children)Returns all members which are a child of one of the members inparentMembers, sorted by ordinal.voidgetMemberChildren(RolapMember parentMember, List<RolapMember> children)Writes all childrenparentMembertochildren.intgetMemberCount()Returns an estimate of number of members in this hierarchy.List<RolapMember>getMembers()Returns all members of this hierarchy, sorted by ordinal.List<RolapMember>getRootMembers()Returns all members of this hierarchy which do not have a parent, sorted by ordinal.RolapMemberlookupMember(List<Id.Segment> uniqueNameParts, boolean failIfNotFound)Finds a member based upon its unique name.booleansetCache(MemberCache cache)Sets the cache which thisMemberSourcewill write to.
-
-
-
Field Detail
-
hierarchy
protected final RolapHierarchy hierarchy
-
members
protected final List<RolapMember> members
-
-
Constructor Detail
-
ArrayMemberSource
ArrayMemberSource(RolapHierarchy hierarchy, List<RolapMember> members)
-
-
Method Detail
-
getHierarchy
public RolapHierarchy getHierarchy()
Description copied from interface:MemberSourceReturns the hierarchy that this source is reading for.- Specified by:
getHierarchyin interfaceMemberSource
-
setCache
public boolean setCache(MemberCache cache)
Description copied from interface:MemberSourceSets the cache which thisMemberSourcewill write to.Cache-writeback is optional (for example,
SqlMemberSourcesupports it, andArrayMemberSourcedoes not), and the return value from this method indicates whether this object supports it.If this method returns
true, theMemberSource.getMembers(),MemberSource.getRootMembers()andMemberSource.getMemberChildren(mondrian.rolap.RolapMember, java.util.List<mondrian.rolap.RolapMember>)methods must write to the cache, in addition to returning members as a return value.- Specified by:
setCachein interfaceMemberSource- Parameters:
cache- TheMemberCachewhich the caller would like thisMemberSourceto write to.- Returns:
- Whether this
MemberSourcesupports cache-writeback.
-
getMembers
public List<RolapMember> getMembers()
Description copied from interface:MemberSourceReturns all members of this hierarchy, sorted by ordinal.If this object
supports cache-writeaback, also writes these members to the cache.- Specified by:
getMembersin interfaceMemberSource
-
getMemberCount
public int getMemberCount()
Description copied from interface:MemberSourceReturns an estimate of number of members in this hierarchy.- Specified by:
getMemberCountin interfaceMemberSource
-
getRootMembers
public List<RolapMember> getRootMembers()
Description copied from interface:MemberSourceReturns all members of this hierarchy which do not have a parent, sorted by ordinal.If this object
supports cache-writeback, also writes these members to the cache.- Specified by:
getRootMembersin interfaceMemberSource- Returns:
ListofRolapMembers
-
getMemberChildren
public void getMemberChildren(RolapMember parentMember, List<RolapMember> children)
Description copied from interface:MemberSourceWrites all childrenparentMembertochildren.If this object
supports cache-writeback, also writes these members to the cache.- Specified by:
getMemberChildrenin interfaceMemberSource
-
getMemberChildren
public void getMemberChildren(List<RolapMember> parentMembers, List<RolapMember> children)
Description copied from interface:MemberSourceReturns all members which are a child of one of the members inparentMembers, sorted by ordinal.If this object
supports cache-writeaback, also writes these members to the cache.- Specified by:
getMemberChildrenin interfaceMemberSource
-
lookupMember
public RolapMember lookupMember(List<Id.Segment> uniqueNameParts, boolean failIfNotFound)
Description copied from interface:MemberSourceFinds a member based upon its unique name.- Specified by:
lookupMemberin interfaceMemberSource
-
-