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
Version:
$Id: //open/mondrian/src/main/mondrian/olap/DimensionBase.java#27 $
Author:
jhyde

Field Summary
protected  java.lang.String description
           
protected  DimensionType dimensionType
           
protected  Hierarchy[] hierarchies
           
protected  boolean highCardinality
           
protected  java.lang.String name
           
protected  java.lang.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(java.lang.String name, DimensionType dimensionType, boolean highCardinality)
          Creates a DimensionBase.
 
Method Summary
 java.lang.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()
           
 java.lang.String getName()
           
 java.lang.String getQualifiedName()
          Returns the name of this element qualified by its class, for example "hierarchy 'Customers'".
 java.lang.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, 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
getSchema
 
Methods inherited from interface mondrian.olap.OlapElement
getCaption
 

Field Detail

name

protected final java.lang.String name

uniqueName

protected final java.lang.String uniqueName

description

protected final java.lang.String description

highCardinality

protected final boolean highCardinality

hierarchies

protected Hierarchy[] hierarchies

dimensionType

protected DimensionType dimensionType
Constructor Detail

DimensionBase

protected DimensionBase(java.lang.String name,
                        DimensionType dimensionType,
                        boolean highCardinality)
Creates a DimensionBase.

Parameters:
name - Name
dimensionType - Type
highCardinality - Whether high-cardinality
Method Detail

getUniqueName

public java.lang.String getUniqueName()
Specified by:
getUniqueName in interface OlapElement

getName

public java.lang.String getName()
Specified by:
getName in interface OlapElement

getDescription

public java.lang.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 java.lang.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

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

Get Mondrian at SourceForge.net. Fast, secure and free Open Source software downloads