Class RolapMemberBase
- All Implemented Interfaces:
Comparable,Annotated,Member,OlapElement,RolapMember
- Direct Known Subclasses:
DelegatingRolapMember,RolapBaseCubeMeasure,RolapCalculatedMember,RolapVirtualCubeMeasure,VisualTotalsFunDef.VisualTotalMember
RolapHierarchy.- Since:
- 10 August, 2001
- Author:
- jhyde
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classDefaultRolapMemberBase.PropertyValueMapFactoryimplementation, used ifMondrianProperties.PropertyValueMapFactoryClassis not set.static interfaceInterface definition for the pluggable factory used to decide which implementation ofMapto use to store property string/value pairs for member properties.static final classCreates the PropertyValueMapFactory which is in turn used to create property-value maps for member properties.Nested classes/interfaces inherited from interface mondrian.olap.Member
Member.MemberTypeNested classes/interfaces inherited from interface mondrian.olap.OlapElement
OlapElement.LocalizedProperty -
Field Summary
Fields inherited from class mondrian.olap.MemberBase
flags, level, parentMember, uniqueNameFields inherited from class mondrian.olap.OlapElementBase
caption, visible -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedRolapMemberBase(RolapMember parentMember, RolapLevel level, Object key, String name, Member.MemberType memberType) Creates a RolapMemberBase. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanintCompares this member to anotherRolapMemberBase.booleanbooleanbooleangetAllMembers(SchemaReader schemaReader, Hierarchy hierarchy) Returns a list of member lists where the first member list is the root members while the last member array is the leaf members.Returns a list of annotations.An object value to be formatted further by member formatter.getCompiledExpression(mondrian.rolap.RolapEvaluatorRoot root) intgetDepth()returns the depth of this member, which is not the level's depth in case of parent child dimensionsstatic intgetHierarchyCardinality(SchemaReader schemaReader, Hierarchy hierarchy) intgetKey()getLevel()protected org.apache.logging.log4j.LoggergetName()Returns the order key of this member among its siblings.intReturns the ordinal of this member within its hierarchy.Returns this member's parent, or null (not the 'null member', as returned byHierarchy.getNullMember()) if it has no parent.Property[]Returns the definitions of the properties this member may have.getPropertyFormattedValue(String propertyName) Returns the formatted value of the property namedpropertyName.protected ObjectgetPropertyFromMap(String propertyName, boolean matchCase) Returns the value of a property by looking it up in the property map.getPropertyValue(String propertyName) Returns the value of the property namedpropertyName.getPropertyValue(String propertyName, boolean matchCase) Returns the value of the property namedpropertyName, matching according to the required case-sensitivity.intReturns the solve order of this calculation.inthashCode()booleanDeprecated.booleanReturns whether this member is computed from aWITH MEMBERclause in an MDX query.booleanisHidden()Returns whether this member is 'hidden', as per the rules which define a ragged hierarchy.booleanprotected static StringkeyToString(Object key) Converts a key to a string to be used as part of the member's name and unique name.voidsetCaptionValue(Object captionValue) voidsetContextIn(RolapEvaluator evaluator) voidOnly allowable if the member is part of theWITHclause of a query.protected voidsetOrdinal(int ordinal, boolean forced) static voidsetOrdinals(SchemaReader schemaReader, Member seedMember) Sets member ordinal values using a Bottom-up/Top-down algorithm.voidsetProperty(String name, Object value) Sets a property of this member to a given value.protected voidsetUniqueName(Object key) Methods inherited from class mondrian.olap.MemberBase
computeCalculated, getAncestorMembers, getCaption, getDataMember, getDescription, getDimension, getExpression, getMemberType, getParentUniqueName, getQualifiedName, getSolveOrder, getUniqueName, isAll, isCalculated, isChildOrEqualTo, isChildOrEqualTo, isEvaluated, isMeasure, isNull, isOnSameHierarchyChain, isOnSameHierarchyChainInternal, isParentChildPhysicalMember, lookupChildMethods inherited from class mondrian.olap.OlapElementBase
clone, computeHashCode, getLocalized, isVisible, setCaption, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface mondrian.olap.Member
getAncestorMembers, getDataMember, getExpression, getMemberType, getParentUniqueName, getSolveOrder, isAll, isCalculated, isChildOrEqualTo, isEvaluated, isMeasure, isNull, isOnSameHierarchyChain, isParentChildPhysicalMemberMethods inherited from interface mondrian.olap.OlapElement
getCaption, getDescription, getDimension, getLocalized, getQualifiedName, getUniqueName, isVisible, lookupChild
-
Constructor Details
-
RolapMemberBase
protected RolapMemberBase(RolapMember parentMember, RolapLevel level, Object key, String name, Member.MemberType memberType) Creates a RolapMemberBase.- Parameters:
parentMember- Parent memberlevel- Level this member belongs tokey- Key to this member in the underlying RDBMSname- Name of this membermemberType- Type of member
-
RolapMemberBase
protected RolapMemberBase()
-
-
Method Details
-
getLogger
protected org.apache.logging.log4j.Logger getLogger()- Specified by:
getLoggerin classOlapElementBase
-
getLevel
- Specified by:
getLevelin interfaceMember- Specified by:
getLevelin interfaceRolapMember- Overrides:
getLevelin classMemberBase
-
getHierarchy
- Specified by:
getHierarchyin interfaceMember- Specified by:
getHierarchyin interfaceOlapElement- Specified by:
getHierarchyin interfaceRolapMember- Overrides:
getHierarchyin classMemberBase
-
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 classMemberBase
-
getCaptionValue
An object value to be formatted further by member formatter. Actually, acts like MemberBase#getCaption(), but using not formatted object values. -
setCaptionValue
-
getAnnotationMap
Description copied from interface:AnnotatedReturns a list of annotations.The map may be empty, never null.
- Specified by:
getAnnotationMapin interfaceAnnotated- Returns:
- Map from annotation name to annotations.
-
hashCode
public int hashCode()- Overrides:
hashCodein classOlapElementBase
-
equals
- Overrides:
equalsin classOlapElementBase
-
equals
- Overrides:
equalsin classOlapElementBase
-
setUniqueName
-
isCalculatedInQuery
public boolean isCalculatedInQuery()Description copied from interface:MemberReturns whether this member is computed from aWITH MEMBERclause in an MDX query.- Specified by:
isCalculatedInQueryin interfaceMember
-
getName
- Specified by:
getNamein interfaceOlapElement- Specified by:
getNamein classMemberBase
-
setName
Description copied from interface:MemberOnly allowable if the member is part of theWITHclause of a query. -
setProperty
Sets 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
-
getPropertyValue
Description copied from interface:MemberReturns the value of the property namedpropertyName. Name match is case-sensitive.- Specified by:
getPropertyValuein interfaceMember
-
getPropertyValue
Description copied from interface:MemberReturns the value of the property namedpropertyName, matching according to the required case-sensitivity.- Specified by:
getPropertyValuein interfaceMember
-
getPropertyFromMap
Returns the value of a property by looking it up in the property map.- Parameters:
propertyName- Name of propertymatchCase- Whether to match name case-sensitive- Returns:
- Property value
-
childLevelHasApproxRowCount
protected boolean childLevelHasApproxRowCount() -
isAllMember
public boolean isAllMember()Deprecated.UseMemberBase.isAll(); will be removed in mondrian-4.0- Specified by:
isAllMemberin interfaceRolapMember
-
getProperties
Description copied from interface:MemberReturns the definitions of the properties this member may have.- Specified by:
getPropertiesin interfaceMember
-
getOrdinal
public int getOrdinal()Description copied from class:MemberBaseReturns the ordinal of this member within its hierarchy. The default implementation returns -1.- Specified by:
getOrdinalin interfaceMember- Overrides:
getOrdinalin classMemberBase
-
getOrderKey
Description copied from class:MemberBaseReturns the order key of this member among its siblings. The default implementation returns null.- Specified by:
getOrderKeyin interfaceMember- Overrides:
getOrderKeyin classMemberBase
-
setOrdinal
protected void setOrdinal(int ordinal, boolean forced) -
getKey
- Specified by:
getKeyin interfaceRolapMember
-
compareTo
Compares 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
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- Returns:
- -1 if this is less, 0 if this is the same, 1 if this is greater
-
isHidden
public boolean isHidden()Description copied from interface:MemberReturns whether this member is 'hidden', as per the rules which define a ragged hierarchy.- Specified by:
isHiddenin interfaceMember- Overrides:
isHiddenin classMemberBase
-
getDepth
public int getDepth()Description copied from interface:Memberreturns the depth of this member, which is not the level's depth in case of parent child dimensions -
getPropertyFormattedValue
Description copied from interface:MemberReturns the formatted value of the property namedpropertyName.- Specified by:
getPropertyFormattedValuein interfaceMember- Overrides:
getPropertyFormattedValuein classMemberBase
-
isParentChildLeaf
public boolean isParentChildLeaf()- Specified by:
isParentChildLeafin interfaceMember- Overrides:
isParentChildLeafin classMemberBase- Returns:
- True when the member is a leaf member, meaning it has no children
-
getAllMembers
Returns a list of member lists where the first member list is the root members while the last member array is the leaf members.If you know that you will need to get all or most of the members of a hierarchy, then calling this which gets all of the hierarchy's members all at once is much faster than getting members one at a time.
- Parameters:
schemaReader- Schema readerhierarchy- Hierarchy- Returns:
- List of arrays of members
-
getHierarchyCardinality
-
setOrdinals
Sets member ordinal values using a Bottom-up/Top-down algorithm.Gets an array of members for each level and traverses array for the lowest level, setting each member's parent's parent's etc. member's ordinal if not set working back down to the leaf member and then going to the next leaf member and traversing up again.
The above algorithm only works for a hierarchy that has all of its leaf members in the same level (that is, a non-ragged hierarchy), which is the norm. After all member ordinal values have been set, traverses the array of members, making sure that all members' ordinals have been set. If one is found that is not set, then one must to a full Top-down setting of the ordinals.
The Bottom-up/Top-down algorithm is MUCH faster than the Top-down algorithm.
- Parameters:
schemaReader- Schema readerseedMember- Member
-
keyToString
Converts a key to a string to be used as part of the member's name and unique name.Usually, it just calls
Object.toString(). But if the key is an integer value represented in a floating-point column, we'd prefer the integer value. For example, one member of the[Sales].[Store SQFT]dimension comes out "20319.0" but we'd like it to be "20319". -
containsAggregateFunction
public boolean containsAggregateFunction() -
getCompiledExpression
-
getHierarchyOrdinal
public int getHierarchyOrdinal() -
setContextIn
-
getSolveOrder
int getSolveOrder()Returns the solve order of this calculation. Identifies which order calculations are expanded.- Returns:
- Solve order
-
MemberBase.isAll(); will be removed in mondrian-4.0