Class RolapCubeMember
- java.lang.Object
-
- mondrian.olap.OlapElementBase
-
- mondrian.olap.MemberBase
-
- mondrian.rolap.RolapMemberBase
-
- mondrian.rolap.DelegatingRolapMember
-
- mondrian.rolap.RolapCubeMember
-
- All Implemented Interfaces:
Comparable,Annotated,Member,OlapElement,RolapMember,RolapMemberInCube
- Direct Known Subclasses:
RolapHierarchy.LimitedRollupMember
public class RolapCubeMember extends DelegatingRolapMember implements RolapMemberInCube
RolapCubeMember wraps RolapMembers and binds them to a specific cube. RolapCubeMember wraps or overrides RolapMember methods that directly reference the wrapped Member. Methods that only contain calls to other methods do not need wrapped.- Author:
- Will Gorman, 19 October 2007
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class mondrian.rolap.RolapMemberBase
RolapMemberBase.DefaultPropertyValueMapFactory, RolapMemberBase.PropertyValueMapFactory, RolapMemberBase.PropertyValueMapFactoryFactory
-
Nested classes/interfaces inherited from interface mondrian.olap.Member
Member.MemberType
-
Nested classes/interfaces inherited from interface mondrian.olap.OlapElement
OlapElement.LocalizedProperty
-
-
Field Summary
Fields Modifier and Type Field Description protected RolapCubeLevelcubeLevelprotected RolapCubeMemberparentCubeMember-
Fields inherited from class mondrian.rolap.DelegatingRolapMember
member
-
Fields inherited from class mondrian.olap.MemberBase
flags, level, parentMember, uniqueName
-
Fields inherited from class mondrian.olap.OlapElementBase
caption, visible
-
-
Constructor Summary
Constructors Constructor Description RolapCubeMember(RolapCubeMember parent, RolapMember member, RolapCubeLevel cubeLevel)Creates a RolapCubeMember.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description intcompareTo(Object o)Compares this member to anotherRolapMemberBase.booleancontainsAggregateFunction()Returns whether this calculation contains an aggregate function.booleanequals(Object o)booleanequals(OlapElement o)CalcgetCompiledExpression(mondrian.rolap.RolapEvaluatorRoot root)Returns the compiled expression to evaluate the scalar value of the current cell.RolapCubegetCube()Returns the cube this cube member belongs to.RolapCubeMembergetDataMember()Returns the system-generated data member that is associated with a nonleaf member of a dimension.RolapCubeDimensiongetDimension()Returns the dimension of a this expression, or null if no dimension is defined.ExpgetExpression()Returns the expression by which this member is calculated.RolapCubeHierarchygetHierarchy()intgetHierarchyOrdinal()Returns the ordinal of this calculation; to resolve ties.RolapCubeLevelgetLevel()RolapCubeMembergetParentMember()Returns this member's parent, or null (not the 'null member', as returned byHierarchy.getNullMember()) if it has no parent.ObjectgetPropertyValue(String propertyName)Returns the value of the property namedpropertyName.ObjectgetPropertyValue(String propertyName, boolean matchCase)Returns the value of the property namedpropertyName, matching according to the required case-sensitivity.RolapMembergetRolapMember()Returns the underlying member.intgetSolveOrder()Returns the solve order of this calculation.StringgetUniqueName()inthashCode()booleanisCalculatedInQuery()Returns whether this calculation is a member is computed from aWITH MEMBERclause in an MDX query.OlapElementlookupChild(SchemaReader schemaReader, Id.Segment childName, MatchType matchType)Looks up a child element, returning null if it does not exist.voidsetContextIn(RolapEvaluator evaluator)Pushes this calculated member or tuple onto the stack of evaluation contexts, and sets the context to the default member of the hierarchy.voidsetProperty(String name, Object value)Sets a property of this member to a given value.StringtoString()-
Methods inherited from class mondrian.rolap.DelegatingRolapMember
getAncestorMembers, getAnnotationMap, getCaption, getDepth, getDescription, getKey, getMemberType, getName, getOrderKey, getOrdinal, getParentUniqueName, getProperties, getPropertyFormattedValue, getQualifiedName, getSolveOrder, isAll, isAllMember, isCalculated, isCalculatedInQuery, isChildOrEqualTo, isEvaluated, isHidden, isMeasure, isNull, isParentChildLeaf, isParentChildPhysicalMember, setName
-
Methods inherited from class mondrian.rolap.RolapMemberBase
childLevelHasApproxRowCount, containsAggregateFunction, getAllMembers, getCaptionValue, getCompiledExpression, getHierarchyCardinality, getHierarchyOrdinal, getLogger, getPropertyFromMap, keyToString, setCaptionValue, setContextIn, setOrdinal, setOrdinals, setUniqueName
-
Methods inherited from class mondrian.olap.MemberBase
computeCalculated, isChildOrEqualTo, isOnSameHierarchyChain, isOnSameHierarchyChainInternal
-
Methods inherited from class mondrian.olap.OlapElementBase
clone, computeHashCode, getLocalized, isVisible, setCaption
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface mondrian.olap.Annotated
getAnnotationMap
-
Methods inherited from interface mondrian.olap.Member
getAncestorMembers, getDepth, getMemberType, getOrderKey, getOrdinal, getParentUniqueName, getProperties, getPropertyFormattedValue, getSolveOrder, isAll, isCalculated, isCalculatedInQuery, isChildOrEqualTo, isEvaluated, isHidden, isMeasure, isNull, isOnSameHierarchyChain, isParentChildLeaf, isParentChildPhysicalMember, setName
-
Methods inherited from interface mondrian.olap.OlapElement
getCaption, getDescription, getLocalized, getName, getQualifiedName, isVisible
-
Methods inherited from interface mondrian.rolap.RolapMember
getKey, isAllMember
-
-
-
-
Field Detail
-
cubeLevel
protected final RolapCubeLevel cubeLevel
-
parentCubeMember
protected final RolapCubeMember parentCubeMember
-
-
Constructor Detail
-
RolapCubeMember
public RolapCubeMember(RolapCubeMember parent, RolapMember member, RolapCubeLevel cubeLevel)
Creates a RolapCubeMember.- Parameters:
parent- Parent membermember- Member of underlying (non-cube) hierarchycubeLevel- Level
-
-
Method Detail
-
getUniqueName
public String getUniqueName()
- Specified by:
getUniqueNamein interfaceOlapElement- Overrides:
getUniqueNamein classDelegatingRolapMember
-
getRolapMember
public final RolapMember getRolapMember()
Returns the underlying member. This is a member of a shared dimension and does not belong to a cube.- Returns:
- Underlying member
-
getCube
public final RolapCube getCube()
Description copied from interface:RolapMemberInCubeReturns the cube this cube member belongs to.This method is not in the
RolapMemberinterface, because regular members may be shared, and therefore do not belong to a specific cube.- Specified by:
getCubein interfaceRolapMemberInCube- Returns:
- Cube this cube member belongs to, never null
-
getDataMember
public final RolapCubeMember getDataMember()
Description copied from interface:MemberReturns the system-generated data member that is associated with a nonleaf member of a dimension.Returns this member if this member is a leaf member, or if the nonleaf member does not have an associated data member.
- Specified by:
getDataMemberin interfaceMember- Overrides:
getDataMemberin classDelegatingRolapMember
-
compareTo
public int compareTo(Object o)
Description copied from class:RolapMemberBaseCompares this member to anotherRolapMemberBase.The method first compares on keys; null keys always collate last. If the keys are equal, it compares using unique name.
This method does not consider
RolapMemberBase.ordinalfield, because ordinal is only unique within a parent. If you want to compare members which may be at any position in the hierarchy, useFunUtil.compareHierarchically(mondrian.olap.Member, mondrian.olap.Member, boolean).- Specified by:
compareToin interfaceComparable- Overrides:
compareToin classDelegatingRolapMember- Returns:
- -1 if this is less, 0 if this is the same, 1 if this is greater
-
toString
public String toString()
- Overrides:
toStringin classOlapElementBase
-
hashCode
public int hashCode()
- Overrides:
hashCodein classRolapMemberBase
-
equals
public boolean equals(Object o)
- Overrides:
equalsin classRolapMemberBase
-
equals
public boolean equals(OlapElement o)
- Overrides:
equalsin classRolapMemberBase
-
getHierarchy
public final RolapCubeHierarchy getHierarchy()
- Specified by:
getHierarchyin interfaceMember- Specified by:
getHierarchyin interfaceOlapElement- Specified by:
getHierarchyin interfaceRolapMember- Overrides:
getHierarchyin classDelegatingRolapMember
-
getDimension
public final RolapCubeDimension getDimension()
Description copied from interface:OlapElementReturns the dimension of a this expression, or null if no dimension is defined. Applicable only to set expressions.Example 1:
has dimension[Sales].children
[Sales].Example 2:
has dimension [Promotion Media].order(except([Promotion Media].[Media Type].members, {[Promotion Media].[Media Type].[No Media]}), [Measures].[Unit Sales], DESC)Example 3:
has no dimension (well, actually it is [Product] x [Gender], but we can't represent that, so we return null);CrossJoin([Product].[Product Department].members, [Gender].members)- Specified by:
getDimensionin interfaceOlapElement- Overrides:
getDimensionin classDelegatingRolapMember
-
getLevel
public final RolapCubeLevel getLevel()
This method is central to how RolapCubeMember works. It allows a member from the cache to be used within different usages of the same shared dimension. The cache member is the same, but the RolapCubeMembers wrapping the cache member report that they belong to different levels, and hence different hierarchies, dimensions, and cubes.
- Specified by:
getLevelin interfaceMember- Specified by:
getLevelin interfaceRolapMember- Overrides:
getLevelin classDelegatingRolapMember
-
setProperty
public void setProperty(String name, Object value)
Description copied from class:RolapMemberBaseSets a property of this member to a given value.WARNING: Setting system properties such as "$name" may have nasty side-effects.
- Specified by:
setPropertyin interfaceMember- Overrides:
setPropertyin classDelegatingRolapMember
-
getPropertyValue
public Object getPropertyValue(String propertyName, boolean matchCase)
Description copied from interface:MemberReturns the value of the property namedpropertyName, matching according to the required case-sensitivity.- Specified by:
getPropertyValuein interfaceMember- Overrides:
getPropertyValuein classDelegatingRolapMember
-
getPropertyValue
public Object getPropertyValue(String propertyName)
Description copied from interface:MemberReturns the value of the property namedpropertyName. Name match is case-sensitive.- Specified by:
getPropertyValuein interfaceMember- Overrides:
getPropertyValuein classDelegatingRolapMember
-
getParentMember
public final RolapCubeMember getParentMember()
Description copied from interface:MemberReturns this member's parent, or null (not the 'null member', as returned byHierarchy.getNullMember()) if it has no parent.In an access-control context, a member may have no visible parents, so use
SchemaReader.getMemberParent(mondrian.olap.Member).- Specified by:
getParentMemberin interfaceMember- Specified by:
getParentMemberin interfaceRolapMember- Overrides:
getParentMemberin classDelegatingRolapMember
-
getExpression
public Exp getExpression()
Description copied from class:MemberBaseReturns the expression by which this member is calculated. The expression is not null if and only if the member is not calculated.- Specified by:
getExpressionin interfaceMember- Overrides:
getExpressionin classDelegatingRolapMember
-
lookupChild
public OlapElement lookupChild(SchemaReader schemaReader, Id.Segment childName, MatchType matchType)
Description copied from interface:OlapElementLooks up a child element, returning null if it does not exist.- Specified by:
lookupChildin interfaceOlapElement- Overrides:
lookupChildin classDelegatingRolapMember
-
setContextIn
public abstract void setContextIn(RolapEvaluator evaluator)
Pushes this calculated member or tuple onto the stack of evaluation contexts, and sets the context to the default member of the hierarchy.- Parameters:
evaluator- Evaluator
-
getSolveOrder
public abstract int getSolveOrder()
Returns the solve order of this calculation. Identifies which order calculations are expanded.- Returns:
- Solve order
-
getHierarchyOrdinal
public abstract int getHierarchyOrdinal()
Returns the ordinal of this calculation; to resolve ties.- Returns:
- Ordinal or calculation
-
isCalculatedInQuery
public abstract boolean isCalculatedInQuery()
Returns whether this calculation is a member is computed from aWITH MEMBERclause in an MDX query.- Returns:
- whether this calculation is computed in an MDX query
-
getCompiledExpression
public abstract Calc getCompiledExpression(mondrian.rolap.RolapEvaluatorRoot root)
Returns the compiled expression to evaluate the scalar value of the current cell. This method will be called frequently, so the implementation should probably compile once and cache the result.- Parameters:
root- Root evaluation context- Returns:
- Compiled scalar expression
-
containsAggregateFunction
public abstract boolean containsAggregateFunction()
Returns whether this calculation contains an aggregate function.- Returns:
- Whether this calculation contains an aggregate function.
-
-