Package mondrian.rolap
Interface MemberCache
-
- All Known Implementing Classes:
CacheMemberReader
,MemberCacheHelper
,MemberNoCacheHelper
,NoCacheMemberReader
,RolapCubeHierarchy.NoCacheRolapCubeHierarchyMemberReader
interface MemberCache
AMemberCache
can retrieve members based upon their parent and name.- Since:
- 22 December, 2001
- Author:
- jhyde
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description List<RolapMember>
getChildrenFromCache(RolapMember parent, MemberChildrenConstraint constraint)
Returns the children ofmember
if they are currently in the cache, otherwise returns null.List<RolapMember>
getLevelMembersFromCache(RolapLevel level, TupleConstraint constraint)
Returns the members oflevel
if they are currently in the cache, otherwise returns null.RolapMember
getMember(Object key)
Retrieves theRolapMember
with a given key.RolapMember
getMember(Object key, boolean mustCheckCacheStatus)
Retrieves theRolapMember
with a given key.boolean
isMutable()
Returns whether the cache supports removing selected items.Object
makeKey(RolapMember parent, Object key)
Creates a key with which togetMember(Object)
orputMember(Object, RolapMember)
theRolapMember
with a given parent and key.void
putChildren(RolapLevel level, TupleConstraint constraint, List<RolapMember> children)
void
putChildren(RolapMember member, MemberChildrenConstraint constraint, List<RolapMember> children)
Object
putMember(Object key, RolapMember member)
Replaces theRolapMember
with a given key and returns the previous member if any.RolapMember
removeMember(Object key)
Removes theRolapMember
with a given key from the cache.RolapMember
removeMemberAndDescendants(Object key)
Removes the designatedRolapMember
and all its descendants.
-
-
-
Method Detail
-
makeKey
Object makeKey(RolapMember parent, Object key)
Creates a key with which togetMember(Object)
orputMember(Object, RolapMember)
theRolapMember
with a given parent and key.- Parameters:
parent
- Parent memberkey
- Key of member within parent- Returns:
- key with which to address this member in the cache
-
getMember
RolapMember getMember(Object key)
Retrieves theRolapMember
with a given key.- Parameters:
key
- cache key, created bymakeKey(mondrian.rolap.RolapMember, java.lang.Object)
- Returns:
- member with a given cache key
-
getMember
RolapMember getMember(Object key, boolean mustCheckCacheStatus)
Retrieves theRolapMember
with a given key.- Parameters:
key
- cache key, created bymakeKey(mondrian.rolap.RolapMember, java.lang.Object)
mustCheckCacheStatus
- Iftrue
, do not check cache status- Returns:
- member with a given cache key
-
putMember
Object putMember(Object key, RolapMember member)
Replaces theRolapMember
with a given key and returns the previous member if any.- Parameters:
key
- cache key, created bymakeKey(mondrian.rolap.RolapMember, java.lang.Object)
member
- new member- Returns:
- Previous member with that key, or null.
-
isMutable
boolean isMutable()
Returns whether the cache supports removing selected items. If it does, it is valid to call theremoveMember(Object)
andremoveMemberAndDescendants(Object)
methods.REVIEW: remove isMutable and move removeMember and removeMemberAndDescendants to new interface MutableMemberCache
- Returns:
- true if the cache supports removing selected items.
-
removeMember
RolapMember removeMember(Object key)
Removes theRolapMember
with a given key from the cache. Returns the previous member with that key, or null. Optional operation: seeisMutable()
.- Parameters:
key
- cache key, created bymakeKey(mondrian.rolap.RolapMember, java.lang.Object)
- Returns:
- previous member with that key, or null
-
removeMemberAndDescendants
RolapMember removeMemberAndDescendants(Object key)
Removes the designatedRolapMember
and all its descendants. Returns the previous member with that key, or null. Optional operation: seeisMutable()
.- Parameters:
key
- cache key, created bymakeKey(mondrian.rolap.RolapMember, java.lang.Object)
- Returns:
- previous member with that key, or null
-
getChildrenFromCache
List<RolapMember> getChildrenFromCache(RolapMember parent, MemberChildrenConstraint constraint)
Returns the children ofmember
if they are currently in the cache, otherwise returns null.The children may be garbage collected as soon as the returned list may be garbage collected.
- Parameters:
parent
- the parent memberconstraint
- the condition that was used when the members were fetched. May be null for all members (no constraint)- Returns:
- list of children, or null if not in cache
-
getLevelMembersFromCache
List<RolapMember> getLevelMembersFromCache(RolapLevel level, TupleConstraint constraint)
Returns the members oflevel
if they are currently in the cache, otherwise returns null.The members may be garbage collected as soon as the returned list may be garbage collected.
- Parameters:
level
- the level whose members should be fetchedconstraint
- the condition that was used when the members were fetched. May be null for all members (no constraint)- Returns:
- members of level, or null if not in cache
-
putChildren
void putChildren(RolapMember member, MemberChildrenConstraint constraint, List<RolapMember> children)
- Parameters:
member
- the parent memberconstraint
- the condition that was used when the members were fetched. May be null for all members (no constraint)children
- list of children
-
putChildren
void putChildren(RolapLevel level, TupleConstraint constraint, List<RolapMember> children)
- Parameters:
level
- the parent levelconstraint
- the condition that was used when the members were fetched. May be null for all members (no constraint)children
- list of children
-
-