Package mondrian.olap
Class DimensionBase
- java.lang.Object
-
- mondrian.olap.OlapElementBase
-
- mondrian.olap.DimensionBase
-
- All Implemented Interfaces:
Annotated
,Dimension
,OlapElement
- Direct Known Subclasses:
RolapCubeDimension
public abstract class DimensionBase extends OlapElementBase implements Dimension
Abstract implementation for aDimension
.- Since:
- 6 August, 2001
- Author:
- jhyde
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface mondrian.olap.OlapElement
OlapElement.LocalizedProperty
-
-
Field Summary
Fields Modifier and Type Field Description protected String
description
protected DimensionType
dimensionType
protected Hierarchy[]
hierarchies
protected boolean
highCardinality
protected String
name
protected String
uniqueName
-
Fields inherited from class mondrian.olap.OlapElementBase
caption, visible
-
Fields inherited from interface mondrian.olap.Dimension
MEASURES_NAME, MEASURES_UNIQUE_NAME
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
DimensionBase(String name, String caption, boolean visible, String description, DimensionType dimensionType, boolean highCardinality)
Creates a DimensionBase.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getDescription()
Dimension
getDimension()
Returns the dimension of a this expression, or null if no dimension is defined.DimensionType
getDimensionType()
Returns the type of this dimension (DimensionType.StandardDimension
orDimensionType.TimeDimension
Hierarchy[]
getHierarchies()
Returns an array of the hierarchies which belong to this dimension.Hierarchy
getHierarchy()
String
getName()
String
getQualifiedName()
Returns the name of this element qualified by its class, for example "hierarchy 'Customers'".String
getUniqueName()
boolean
isHighCardinality()
Returns whether the dimension should be considered as a "high cardinality" or "low cardinality" according to cube definition.boolean
isMeasures()
Returns whether this is the[Measures]
dimension.OlapElement
lookupChild(SchemaReader schemaReader, Id.Segment s, 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, getCaption, getLocalized, getLogger, hashCode, isVisible, setCaption, toString
-
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.OlapElement
getCaption, getLocalized, isVisible
-
-
-
-
Field Detail
-
name
protected final String name
-
uniqueName
protected final String uniqueName
-
description
protected final String description
-
highCardinality
protected final boolean highCardinality
-
hierarchies
protected Hierarchy[] hierarchies
-
dimensionType
protected DimensionType dimensionType
-
-
Constructor Detail
-
DimensionBase
protected DimensionBase(String name, String caption, boolean visible, String description, DimensionType dimensionType, boolean highCardinality)
Creates a DimensionBase.- Parameters:
name
- NamedimensionType
- TypehighCardinality
- Whether high-cardinality
-
-
Method Detail
-
getUniqueName
public String getUniqueName()
- Specified by:
getUniqueName
in interfaceOlapElement
-
getName
public String getName()
- Specified by:
getName
in interfaceOlapElement
-
getDescription
public String getDescription()
- Specified by:
getDescription
in interfaceOlapElement
-
getHierarchies
public Hierarchy[] getHierarchies()
Description copied from interface:Dimension
Returns an array of the hierarchies which belong to this dimension.- Specified by:
getHierarchies
in interfaceDimension
-
getHierarchy
public Hierarchy getHierarchy()
- Specified by:
getHierarchy
in interfaceOlapElement
-
getDimension
public Dimension getDimension()
Description copied from interface:OlapElement
Returns 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:
getDimension
in interfaceOlapElement
-
getDimensionType
public DimensionType getDimensionType()
Description copied from interface:Dimension
Returns the type of this dimension (DimensionType.StandardDimension
orDimensionType.TimeDimension
- Specified by:
getDimensionType
in interfaceDimension
-
getQualifiedName
public String getQualifiedName()
Description copied from interface:OlapElement
Returns the name of this element qualified by its class, for example "hierarchy 'Customers'".- Specified by:
getQualifiedName
in interfaceOlapElement
-
isMeasures
public boolean isMeasures()
Description copied from interface:Dimension
Returns whether this is the[Measures]
dimension.- Specified by:
isMeasures
in interfaceDimension
-
lookupChild
public OlapElement lookupChild(SchemaReader schemaReader, Id.Segment s, MatchType matchType)
Description copied from interface:OlapElement
Looks up a child element, returning null if it does not exist.- Specified by:
lookupChild
in interfaceOlapElement
-
isHighCardinality
public boolean isHighCardinality()
Description copied from interface:Dimension
Returns whether the dimension should be considered as a "high cardinality" or "low cardinality" according to cube definition. Mondrian tends to evaluate high cardinality dimensions using iterators rather than lists, avoiding instantiating the dimension in memory.- Specified by:
isHighCardinality
in interfaceDimension
- Returns:
- whether this dimension is high-cardinality
-
-