mondrian.olap
Class DimensionBase

java.lang.Object
  extended by mondrian.olap.OlapElementBase
      extended by mondrian.olap.DimensionBase
All Implemented Interfaces:
Dimension, OlapElement
Direct Known Subclasses:
RolapDimension

public abstract class DimensionBase
extends OlapElementBase
implements Dimension

Abstract implementation for a Dimension.

Since:
6 August, 2001
Author:
jhyde
 

Field Summary
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
 
Fields inherited from interface mondrian.olap.Dimension
MEASURES_NAME, MEASURES_UNIQUE_NAME
 
Constructor Summary
protected DimensionBase(String name, DimensionType dimensionType, boolean highCardinality)
           
 
Method Summary
 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 or DimensionType.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)
          Looks up a child element, returning null if it does not exist.
 OlapElement lookupChild(SchemaReader schemaReader, Id.Segment s, MatchType matchType)
           
 boolean usesDimension(Dimension dimension)
           
 
Methods inherited from class mondrian.olap.OlapElementBase
clone, computeHashCode, equals, equals, getCaption, getLogger, hashCode, setCaption, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface mondrian.olap.Dimension
getOrdinal, getSchema
 
Methods inherited from interface mondrian.olap.OlapElement
getCaption
 

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,
                        DimensionType dimensionType,
                        boolean highCardinality)
Method Detail

getUniqueName

public String getUniqueName()
Specified by:
getUniqueName in interface OlapElement

getName

public String getName()
Specified by:
getName in interface OlapElement

getDescription

public String getDescription()
Specified by:
getDescription in interface OlapElement

getHierarchies

public Hierarchy[] getHierarchies()
Description copied from interface: Dimension
Returns an array of the hierarchies which belong to this dimension.

Specified by:
getHierarchies in interface Dimension

getHierarchy

public Hierarchy getHierarchy()
Specified by:
getHierarchy in interface OlapElement

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:

 [Sales].children
 
has dimension [Sales].

Example 2:

 order(except([Promotion Media].[Media Type].members,
              {[Promotion Media].[Media Type].[No Media]}),
       [Measures].[Unit Sales], DESC)
 
has dimension [Promotion Media].

Example 3:

 CrossJoin([Product].[Product Department].members,
           [Gender].members)
 
has no dimension (well, actually it is [Product] x [Gender], but we can't represent that, so we return null);

Specified by:
getDimension in interface OlapElement

getDimensionType

public DimensionType getDimensionType()
Description copied from interface: Dimension
Returns the type of this dimension (DimensionType.StandardDimension or DimensionType.TimeDimension

Specified by:
getDimensionType in interface Dimension

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 interface OlapElement

isMeasures

public boolean isMeasures()
Description copied from interface: Dimension
Returns whether this is the [Measures] dimension.

Specified by:
isMeasures in interface Dimension

usesDimension

public boolean usesDimension(Dimension dimension)

lookupChild

public OlapElement lookupChild(SchemaReader schemaReader,
                               Id.Segment s)
Description copied from interface: OlapElement
Looks up a child element, returning null if it does not exist.

Specified by:
lookupChild in interface OlapElement

lookupChild

public OlapElement lookupChild(SchemaReader schemaReader,
                               Id.Segment s,
                               MatchType matchType)
Specified by:
lookupChild in interface OlapElement

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 interface Dimension
Returns:
whether this dimension is high-cardinality

SourceForge.net_Logo