public class RolapMemberBase extends MemberBase implements RolapMember
RolapHierarchy
.Modifier and Type | Class and Description |
---|---|
static class |
RolapMemberBase.DefaultPropertyValueMapFactory
Default
RolapMemberBase.PropertyValueMapFactory
implementation, used if
MondrianProperties.PropertyValueMapFactoryClass
is not set. |
static interface |
RolapMemberBase.PropertyValueMapFactory
Interface definition for the pluggable factory used to decide
which implementation of
Map to use to store
property string/value pairs for member properties. |
static class |
RolapMemberBase.PropertyValueMapFactoryFactory
Creates the PropertyValueMapFactory which is in turn used
to create property-value maps for member properties.
|
Member.MemberType
OlapElement.LocalizedProperty
flags, level, parentMember, uniqueName
caption, visible
Modifier | Constructor and Description |
---|---|
protected |
RolapMemberBase() |
protected |
RolapMemberBase(RolapMember parentMember,
RolapLevel level,
Object key,
String name,
Member.MemberType memberType)
Creates a RolapMemberBase.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
childLevelHasApproxRowCount() |
int |
compareTo(Object o)
Compares this member to another
RolapMemberBase . |
boolean |
containsAggregateFunction()
Returns whether this calculation contains an aggregate function.
|
boolean |
equals(Object o) |
boolean |
equals(OlapElement o) |
static List<List<Member>> |
getAllMembers(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.
|
Map<String,Annotation> |
getAnnotationMap()
Returns a list of annotations.
|
Object |
getCaptionValue()
An object value to be formatted further by member formatter.
|
Calc |
getCompiledExpression(mondrian.rolap.RolapEvaluatorRoot root)
Returns the compiled expression to evaluate the scalar value of the
current cell.
|
int |
getDepth()
returns the depth of this member, which is not the level's depth
in case of parent child dimensions
|
RolapHierarchy |
getHierarchy() |
static int |
getHierarchyCardinality(SchemaReader schemaReader,
Hierarchy hierarchy) |
int |
getHierarchyOrdinal()
Returns the ordinal of this calculation; to resolve ties.
|
Object |
getKey() |
RolapLevel |
getLevel() |
protected org.apache.log4j.Logger |
getLogger() |
String |
getName() |
Comparable |
getOrderKey()
Returns the order key of this member among its siblings.
|
int |
getOrdinal()
Returns the ordinal of this member within its hierarchy.
|
RolapMember |
getParentMember()
Returns this member's parent, or null (not the 'null member', as
returned by
Hierarchy.getNullMember() ) if it has no parent. |
Property[] |
getProperties()
Returns the definitions of the properties this member may have.
|
String |
getPropertyFormattedValue(String propertyName)
Returns the formatted value of the property named
propertyName . |
protected Object |
getPropertyFromMap(String propertyName,
boolean matchCase)
Returns the value of a property by looking it up in the property map.
|
Object |
getPropertyValue(String propertyName)
Returns the value of the property named
propertyName . |
Object |
getPropertyValue(String propertyName,
boolean matchCase)
Returns the value of the property named
propertyName ,
matching according to the required case-sensitivity. |
int |
getSolveOrder()
Returns the solve order of this calculation.
|
int |
hashCode() |
boolean |
isAllMember()
Deprecated.
Use
MemberBase.isAll() ; will be removed in mondrian-4.0 |
boolean |
isCalculatedInQuery()
Returns whether this member is computed from a
WITH MEMBER
clause in an MDX query. |
boolean |
isHidden()
Returns whether this member is 'hidden', as per the rules which define
a ragged hierarchy.
|
boolean |
isParentChildLeaf() |
protected static String |
keyToString(Object key)
Converts a key to a string to be used as part of the member's name
and unique name.
|
void |
setCaptionValue(Object captionValue) |
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.
|
void |
setName(String name)
Only allowable if the member is part of the
WITH clause of
a query. |
protected void |
setOrdinal(int ordinal,
boolean forced) |
static void |
setOrdinals(SchemaReader schemaReader,
Member seedMember)
Sets member ordinal values using a Bottom-up/Top-down algorithm.
|
void |
setProperty(String name,
Object value)
Sets a property of this member to a given value.
|
protected void |
setUniqueName(Object key) |
computeCalculated, getAncestorMembers, getCaption, getDataMember, getDescription, getDimension, getExpression, getMemberType, getParentUniqueName, getQualifiedName, getSolveOrder, getUniqueName, isAll, isCalculated, isChildOrEqualTo, isChildOrEqualTo, isEvaluated, isMeasure, isNull, isParentChildPhysicalMember, lookupChild
clone, computeHashCode, getLocalized, isVisible, setCaption, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
getAncestorMembers, getDataMember, getExpression, getMemberType, getParentUniqueName, getSolveOrder, isAll, isCalculated, isChildOrEqualTo, isEvaluated, isMeasure, isNull, isParentChildPhysicalMember
getCaption, getDescription, getDimension, getLocalized, getQualifiedName, getUniqueName, isVisible, lookupChild
protected RolapMemberBase(RolapMember parentMember, RolapLevel level, Object key, String name, Member.MemberType memberType)
parentMember
- Parent memberlevel
- Level this member belongs tokey
- Key to this member in the underlying RDBMSname
- Name of this membermemberType
- Type of memberprotected RolapMemberBase()
protected org.apache.log4j.Logger getLogger()
getLogger
in class OlapElementBase
public RolapLevel getLevel()
getLevel
in interface Member
getLevel
in interface RolapMember
getLevel
in class MemberBase
public RolapHierarchy getHierarchy()
getHierarchy
in interface Member
getHierarchy
in interface OlapElement
getHierarchy
in interface RolapMember
getHierarchy
in class MemberBase
public RolapMember getParentMember()
Member
Hierarchy.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)
.
getParentMember
in interface Member
getParentMember
in interface RolapMember
getParentMember
in class MemberBase
public Object getCaptionValue()
public void setCaptionValue(Object captionValue)
public Map<String,Annotation> getAnnotationMap()
Annotated
The map may be empty, never null.
getAnnotationMap
in interface Annotated
public int hashCode()
hashCode
in class OlapElementBase
public boolean equals(Object o)
equals
in class OlapElementBase
public boolean equals(OlapElement o)
equals
in class OlapElementBase
protected void setUniqueName(Object key)
public boolean isCalculatedInQuery()
Member
WITH MEMBER
clause in an MDX query.isCalculatedInQuery
in interface Member
public String getName()
getName
in interface OlapElement
getName
in class MemberBase
public void setName(String name)
Member
WITH
clause of
a query.public void setProperty(String name, Object value)
WARNING: Setting system properties such as "$name" may have nasty side-effects.
setProperty
in interface Member
public Object getPropertyValue(String propertyName)
Member
propertyName
.
Name match is case-sensitive.getPropertyValue
in interface Member
public Object getPropertyValue(String propertyName, boolean matchCase)
Member
propertyName
,
matching according to the required case-sensitivity.getPropertyValue
in interface Member
protected Object getPropertyFromMap(String propertyName, boolean matchCase)
propertyName
- Name of propertymatchCase
- Whether to match name case-sensitiveprotected boolean childLevelHasApproxRowCount()
public boolean isAllMember()
MemberBase.isAll()
; will be removed in mondrian-4.0isAllMember
in interface RolapMember
public Property[] getProperties()
Member
getProperties
in interface Member
public int getOrdinal()
MemberBase
getOrdinal
in interface Member
getOrdinal
in class MemberBase
public Comparable getOrderKey()
MemberBase
getOrderKey
in interface Member
getOrderKey
in class MemberBase
protected void setOrdinal(int ordinal, boolean forced)
public Object getKey()
getKey
in interface RolapMember
public int compareTo(Object o)
RolapMemberBase
.
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 ordinal
field, because
ordinal is only unique within a parent. If you want to compare
members which may be at any position in the hierarchy, use
FunUtil.compareHierarchically(mondrian.olap.Member, mondrian.olap.Member, boolean)
.
compareTo
in interface Comparable
public boolean isHidden()
Member
isHidden
in interface Member
isHidden
in class MemberBase
public int getDepth()
Member
public String getPropertyFormattedValue(String propertyName)
Member
propertyName
.getPropertyFormattedValue
in interface Member
getPropertyFormattedValue
in class MemberBase
public boolean isParentChildLeaf()
isParentChildLeaf
in interface Member
isParentChildLeaf
in class MemberBase
public static List<List<Member>> getAllMembers(SchemaReader schemaReader, Hierarchy hierarchy)
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.
schemaReader
- Schema readerhierarchy
- Hierarchypublic static int getHierarchyCardinality(SchemaReader schemaReader, Hierarchy hierarchy)
public static void setOrdinals(SchemaReader schemaReader, Member seedMember)
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.
schemaReader
- Schema readerseedMember
- Memberprotected static String keyToString(Object key)
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".
public boolean containsAggregateFunction()
public Calc getCompiledExpression(mondrian.rolap.RolapEvaluatorRoot root)
root
- Root evaluation contextpublic int getHierarchyOrdinal()
public void setContextIn(RolapEvaluator evaluator)
evaluator
- Evaluatorpublic int getSolveOrder()
Copyright © 2019 Hitachi Vantara. All rights reserved.