|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmondrian.olap.OlapElementBase
mondrian.olap.MemberBase
mondrian.rolap.RolapMemberBase
public class RolapMemberBase
Basic implementation of a member in a RolapHierarchy.
| Nested Class Summary | |
|---|---|
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. |
| 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 inherited from class mondrian.olap.MemberBase |
|---|
flags, level, parentMember, uniqueName |
| Fields inherited from class mondrian.olap.OlapElementBase |
|---|
caption, visible |
| Constructor Summary | |
|---|---|
protected |
RolapMemberBase()
|
(package private) |
RolapMemberBase(RolapMember parentMember,
RolapLevel level,
Object value)
|
protected |
RolapMemberBase(RolapMember parentMember,
RolapLevel level,
Object key,
String name,
Member.MemberType memberType)
Creates a RolapMemberBase. |
| Method Summary | |
|---|---|
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. |
Calc |
getCompiledExpression(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 |
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. |
(package private) void |
makeUniqueName(HierarchyUsage hierarchyUsage)
|
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. |
(package private) void |
setOrderKey(Comparable orderKey)
|
(package private) void |
setOrdinal(int ordinal)
|
static void |
setOrdinals(SchemaReader schemaReader,
Member seedMember)
Sets member ordinal values using a Bottom-up/Top-down algorithm. |
(package private) void |
setParentMember(RolapMember parentMember)
Sets a member's parent. |
void |
setProperty(String name,
Object value)
Sets a property of this member to a given value. |
protected void |
setUniqueName(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, lookupChild |
| Methods inherited from class mondrian.olap.OlapElementBase |
|---|
clone, computeHashCode, getLocalized, isVisible, setCaption, toString |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface mondrian.olap.Member |
|---|
getAncestorMembers, getDataMember, getExpression, getMemberType, getParentUniqueName, getSolveOrder, isAll, isCalculated, isChildOrEqualTo, isEvaluated, isMeasure, isNull |
| Methods inherited from interface mondrian.olap.OlapElement |
|---|
getCaption, getDescription, getDimension, getLocalized, getQualifiedName, getUniqueName, isVisible, lookupChild |
| Methods inherited from interface mondrian.rolap.RolapCalculation |
|---|
getSolveOrder |
| Constructor Detail |
|---|
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()
RolapMemberBase(RolapMember parentMember,
RolapLevel level,
Object value)
| Method Detail |
|---|
void setParentMember(RolapMember parentMember)
Can screw up the caching structure. Only to be called by
CacheControl.createMoveCommand(mondrian.olap.Member, mondrian.olap.Member).
New parent must be in same level as old parent.
parentMember - New parent membergetParentMember(),
MemberBase.getParentUniqueName()protected org.apache.log4j.Logger getLogger()
getLogger in class OlapElementBasepublic RolapLevel getLevel()
getLevel in interface MembergetLevel in interface RolapMembergetLevel in class MemberBasepublic RolapHierarchy getHierarchy()
getHierarchy in interface MembergetHierarchy in interface OlapElementgetHierarchy in interface RolapMembergetHierarchy in class MemberBasepublic RolapMember getParentMember()
MemberHierarchy.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 MembergetParentMember in interface RolapMembergetParentMember in class MemberBasepublic Map<String,Annotation> getAnnotationMap()
AnnotatedThe map may be empty, never null.
getAnnotationMap in interface Annotatedpublic int hashCode()
hashCode in class OlapElementBasepublic boolean equals(Object o)
equals in class OlapElementBasepublic boolean equals(OlapElement o)
equals in class OlapElementBasevoid makeUniqueName(HierarchyUsage hierarchyUsage)
protected void setUniqueName(Object key)
public boolean isCalculatedInQuery()
MemberWITH MEMBER
clause in an MDX query.
isCalculatedInQuery in interface MemberisCalculatedInQuery in interface RolapCalculationpublic String getName()
getName in interface OlapElementgetName in class MemberBasepublic void setName(String name)
MemberWITH clause of
a query.
setName in interface Member
public void setProperty(String name,
Object value)
WARNING: Setting system properties such as "$name" may have nasty side-effects.
setProperty in interface Memberpublic Object getPropertyValue(String propertyName)
MemberpropertyName.
Name match is case-sensitive.
getPropertyValue in interface Member
public Object getPropertyValue(String propertyName,
boolean matchCase)
MemberpropertyName,
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-sensitive
protected boolean childLevelHasApproxRowCount()
public boolean isAllMember()
MemberBase.isAll(); will be removed in mondrian-4.0
isAllMember in interface RolapMemberpublic Property[] getProperties()
Member
getProperties in interface Memberpublic int getOrdinal()
MemberBase
getOrdinal in interface MembergetOrdinal in class MemberBasepublic Comparable getOrderKey()
MemberBase
getOrderKey in interface MembergetOrderKey in class MemberBasevoid setOrdinal(int ordinal)
void setOrderKey(Comparable orderKey)
public Object getKey()
getKey in interface RolapMemberpublic 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 Comparablepublic boolean isHidden()
Member
isHidden in interface MemberisHidden in class MemberBasepublic int getDepth()
Member
getDepth in interface Memberpublic String getPropertyFormattedValue(String propertyName)
MemberpropertyName.
getPropertyFormattedValue in interface MembergetPropertyFormattedValue in class MemberBasepublic boolean isParentChildLeaf()
isParentChildLeaf in interface MemberisParentChildLeaf 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 - Hierarchy
public 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()
RolapCalculation
containsAggregateFunction in interface RolapCalculationpublic Calc getCompiledExpression(RolapEvaluatorRoot root)
RolapCalculation
getCompiledExpression in interface RolapCalculationroot - Root evaluation context
public int getHierarchyOrdinal()
RolapCalculation
getHierarchyOrdinal in interface RolapCalculationpublic void setContextIn(RolapEvaluator evaluator)
RolapCalculation
setContextIn in interface RolapCalculationevaluator - Evaluator
|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||