Class MemberBase
- All Implemented Interfaces:
Comparable,Annotated,Member,OlapElement
- Direct Known Subclasses:
RolapMemberBase
MemberBase is a partial implementation of Member.- Since:
- 6 August, 2001
- Author:
- jhyde
-
Nested Class Summary
Nested classes/interfaces inherited from interface mondrian.olap.Member
Member.MemberTypeNested classes/interfaces inherited from interface mondrian.olap.OlapElement
OlapElement.LocalizedProperty -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final intCombines member type and other properties, such as whether the member is the 'all' or 'null' member of its hierarchy and whether it is a measure or is calculated, into an integer field.protected final Levelprotected Memberprotected StringFields inherited from class mondrian.olap.OlapElementBase
caption, visible -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedMemberBase(Member parentMember, Level level, Member.MemberType memberType) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancomputeCalculated(Member.MemberType memberType) Computes the value to be returned byisCalculated(), so it can be cached in a variable.Returns a list of the ancestor members of this member.Returns the display name of this catalog element.Returns the system-generated data member that is associated with a nonleaf member of a dimension.Returns the dimension of a this expression, or null if no dimension is defined.Returns the expression by which this member is calculated.getLevel()Returns the type of member.abstract StringgetName()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.Returns name of parent member, or empty string (not null) if we are the root.getPropertyFormattedValue(String propertyName) Returns the formatted value of the property namedpropertyName.Returns the name of this element qualified by its class, for example "hierarchy 'Customers'".intbooleanisAll()Returns whether this is the 'all' member.booleanReturns whether this member is computed using either awith memberclause in an mdx query or a calculated member defined in cube.booleanisChildOrEqualTo(String uniqueName) Returns whether thisMember's unique name is equal to, a child of, or a descendent of a member whose unique name isuniqueName.booleanisChildOrEqualTo(Member member) Returns whethermemberis equal to, a child, or a descendent of thisMember.booleanReturns whether this member should be evaluated within the Evaluator.booleanisHidden()Returns whether this member is 'hidden', as per the rules which define a ragged hierarchy.booleanReturns whether this is a member of the measures dimension.booleanisNull()Returns whether this is the 'null member'.booleanisOnSameHierarchyChain(Member otherMember) Returns true if this member is on the same hierarchy chain asotherMember.booleanisOnSameHierarchyChainInternal(MemberBase otherMember) booleanbooleanlookupChild(SchemaReader schemaReader, Id.Segment childName, MatchType matchType) Looks up a child element, returning null if it does not exist.Methods inherited from class mondrian.olap.OlapElementBase
clone, computeHashCode, equals, equals, getLocalized, getLogger, hashCode, isVisible, setCaption, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface mondrian.olap.Annotated
getAnnotationMapMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface mondrian.olap.Member
getDepth, getProperties, getPropertyValue, getPropertyValue, isCalculatedInQuery, setName, setPropertyMethods inherited from interface mondrian.olap.OlapElement
getLocalized, isVisible
-
Field Details
-
parentMember
-
level
-
uniqueName
-
flags
protected final int flagsCombines member type and other properties, such as whether the member is the 'all' or 'null' member of its hierarchy and whether it is a measure or is calculated, into an integer field.The fields are:
- bits 0, 1, 2 (
FLAG_TYPE_MASK) are member type; - bit 3 (
FLAG_HIDDEN) is set if the member is hidden; - bit 4 (
FLAG_ALL) is set if this is the all member of its hierarchy; - bit 5 (
FLAG_NULL) is set if this is the null member of its hierarchy; - bit 6 (
FLAG_CALCULATED) is set if this is a calculated member. - bit 7 (
FLAG_MEASURE) is set if this is a measure.
NOTE: jhyde, 2007/8/10. It is necessary to cache whether the member is 'all', 'calculated' or 'null' in the member's state, because these properties are used so often. If we used a virtual method call - say we made each subclass implement 'boolean isNull()' - it would be slower. We use one flags field rather than 4 boolean fields to save space.
- bits 0, 1, 2 (
-
-
Constructor Details
-
MemberBase
-
MemberBase
protected MemberBase()
-
-
Method Details
-
getQualifiedName
Description copied from interface:OlapElementReturns the name of this element qualified by its class, for example "hierarchy 'Customers'".- Specified by:
getQualifiedNamein interfaceOlapElement
-
getName
- Specified by:
getNamein interfaceOlapElement
-
getUniqueName
- Specified by:
getUniqueNamein interfaceOlapElement
-
getCaption
Description copied from class:OlapElementBaseReturns the display name of this catalog element. If no caption is defined, the name is returned.- Specified by:
getCaptionin interfaceOlapElement- Overrides:
getCaptionin classOlapElementBase
-
getParentUniqueName
Description copied from interface:MemberReturns name of parent member, or empty string (not null) if we are the root.- Specified by:
getParentUniqueNamein interfaceMember
-
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
-
getHierarchy
- Specified by:
getHierarchyin interfaceMember- Specified by:
getHierarchyin interfaceOlapElement
-
getLevel
-
getMemberType
Description copied from interface:MemberReturns the type of member.- Specified by:
getMemberTypein interfaceMember
-
getDescription
- Specified by:
getDescriptionin interfaceOlapElement
-
isMeasure
public boolean isMeasure()Description copied from interface:MemberReturns whether this is a member of the measures dimension. -
isAll
public boolean isAll()Description copied from interface:MemberReturns whether this is the 'all' member. -
isNull
public boolean isNull()Description copied from interface:MemberReturns whether this is the 'null member'. -
isCalculated
public boolean isCalculated()Description copied from interface:MemberReturns whether this member is computed using either awith memberclause in an mdx query or a calculated member defined in cube.- Specified by:
isCalculatedin interfaceMember
-
isEvaluated
public boolean isEvaluated()Description copied from interface:MemberReturns whether this member should be evaluated within the Evaluator.Normally
Member.isCalculated()andMember.isEvaluated()should return the same value, but in situations where mondrian would like to treat the two concepts separately such in role based security, these values may differ.- Specified by:
isEvaluatedin interfaceMember- Returns:
- true if evaluated
-
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
-
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
-
isChildOrEqualTo
Description copied from interface:MemberReturns whethermemberis equal to, a child, or a descendent of thisMember.- Specified by:
isChildOrEqualToin interfaceMember
-
isChildOrEqualTo
Returns whether thisMember's unique name is equal to, a child of, or a descendent of a member whose unique name isuniqueName. -
computeCalculated
Computes the value to be returned byisCalculated(), so it can be cached in a variable.- Parameters:
memberType- Member type- Returns:
- Whether this member is calculated
-
getSolveOrder
public int getSolveOrder()- Specified by:
getSolveOrderin interfaceMember
-
getExpression
Returns 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
-
getAncestorMembers
Description copied from interface:MemberReturns a list of the ancestor members of this member.- Specified by:
getAncestorMembersin interfaceMember
-
getOrdinal
public int getOrdinal()Returns the ordinal of this member within its hierarchy. The default implementation returns -1.- Specified by:
getOrdinalin interfaceMember
-
getOrderKey
Returns the order key of this member among its siblings. The default implementation returns null.- Specified by:
getOrderKeyin interfaceMember
-
isHidden
public boolean isHidden()Description copied from interface:MemberReturns whether this member is 'hidden', as per the rules which define a ragged hierarchy. -
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
-
getPropertyFormattedValue
Description copied from interface:MemberReturns the formatted value of the property namedpropertyName.- Specified by:
getPropertyFormattedValuein interfaceMember
-
isParentChildPhysicalMember
public boolean isParentChildPhysicalMember()- Specified by:
isParentChildPhysicalMemberin interfaceMember- Returns:
- True when the member is part of a Parent-Child hierarchy and it is a physical member. In a Parent Child Hierarchy without a closure table, each member needs to be treated as calculated. We need a way to distinguish between true calculated members and physical members that exist in the source data
-
isParentChildLeaf
public boolean isParentChildLeaf()- Specified by:
isParentChildLeafin interfaceMember- Returns:
- True when the member is a leaf member, meaning it has no children
-
isOnSameHierarchyChain
Description copied from interface:MemberReturns true if this member is on the same hierarchy chain asotherMember.- Specified by:
isOnSameHierarchyChainin interfaceMember- Returns:
-
isOnSameHierarchyChainInternal
-