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 a Dimension.
Since:
6 August, 2001
Author:
jhyde
  • Field Details

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

    • DimensionBase

      protected DimensionBase(String name, String caption, boolean visible, String description, DimensionType dimensionType, boolean highCardinality)
      Creates a DimensionBase.
      Parameters:
      name - Name
      dimensionType - Type
      highCardinality - Whether high-cardinality
  • Method Details

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