mondrian.rolap
Class ArrayMemberSource

java.lang.Object
  extended by mondrian.rolap.ArrayMemberSource
All Implemented Interfaces:
MemberSource
Direct Known Subclasses:
MeasureMemberSource

abstract class ArrayMemberSource
extends Object
implements MemberSource

ArrayMemberSource implements a flat, static hierarchy. There is no root member, and all members are siblings.

Since:
22 December, 2001
Author:
jhyde
 

Field Summary
protected  RolapHierarchy hierarchy
           
protected  List<RolapMember> members
           
 
Constructor Summary
ArrayMemberSource(RolapHierarchy hierarchy, List<RolapMember> members)
           
 
Method Summary
 RolapHierarchy getHierarchy()
          Returns the hierarchy that this source is reading for.
 void getMemberChildren(List<RolapMember> parentMembers, List<RolapMember> children)
          Returns all members which are a child of one of the members in parentMembers, sorted by ordinal.
 void getMemberChildren(RolapMember parentMember, List<RolapMember> children)
          Writes all children parentMember to children.
 int getMemberCount()
          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.
 RolapMember lookupMember(List<Id.Segment> uniqueNameParts, boolean failIfNotFound)
          Finds a member based upon its unique name.
 boolean setCache(MemberCache cache)
          Sets the cache which this MemberSource will write to.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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: MemberSource
Returns the hierarchy that this source is reading for.

Specified by:
getHierarchy in interface MemberSource

setCache

public boolean setCache(MemberCache cache)
Description copied from interface: MemberSource
Sets the cache which this MemberSource will write to.

Cache-writeback is optional (for example, SqlMemberSource supports it, and ArrayMemberSource does not), and the return value from this method indicates whether this object supports it.

If this method returns true, the MemberSource.getMembers(), MemberSource.getRootMembers() and MemberSource.getMemberChildren(mondrian.rolap.RolapMember, java.util.List) methods must write to the cache, in addition to returning members as a return value.

Specified by:
setCache in interface MemberSource
Parameters:
cache - The MemberCache which the caller would like this MemberSource to write to.
Returns:
Whether this MemberSource supports cache-writeback.

getMembers

public List<RolapMember> getMembers()
Description copied from interface: MemberSource
Returns all members of this hierarchy, sorted by ordinal.

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

Specified by:
getMembers in interface MemberSource

getMemberCount

public int getMemberCount()
Description copied from interface: MemberSource
Returns an estimate of number of members in this hierarchy.

Specified by:
getMemberCount in interface MemberSource

getRootMembers

public List<RolapMember> getRootMembers()
Description copied from interface: MemberSource
Returns 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:
getRootMembers in interface MemberSource
Returns:
List of RolapMembers

getMemberChildren

public void getMemberChildren(RolapMember parentMember,
                              List<RolapMember> children)
Description copied from interface: MemberSource
Writes all children parentMember to children.

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

Specified by:
getMemberChildren in interface MemberSource

getMemberChildren

public void getMemberChildren(List<RolapMember> parentMembers,
                              List<RolapMember> children)
Description copied from interface: MemberSource
Returns all members which are a child of one of the members in parentMembers, sorted by ordinal.

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

Specified by:
getMemberChildren in interface MemberSource

lookupMember

public RolapMember lookupMember(List<Id.Segment> uniqueNameParts,
                                boolean failIfNotFound)
Description copied from interface: MemberSource
Finds a member based upon its unique name.

Specified by:
lookupMember in interface MemberSource

SourceForge.net_Logo