mondrian.rolap
Class RolapResult

java.lang.Object
  extended by mondrian.olap.ResultBase
      extended by mondrian.rolap.RolapResult
All Implemented Interfaces:
Result

public class RolapResult
extends ResultBase

A RolapResult is the result of running a query.

Since:
10 August, 2001
Version:
$Id: //open/mondrian/src/main/mondrian/rolap/RolapResult.java#138 $
Author:
jhyde

Nested Class Summary
(package private) static class RolapResult.CellFormatterValueFormatter
          A CellFormatterValueFormatter uses a user-defined CellFormatter to format values.
(package private) static class RolapResult.CellInfo
          A CellInfo contains all of the information that a Cell requires.
(package private) static interface RolapResult.CellInfoContainer
          API for the creation and lookup of RolapResult.CellInfo objects.
(package private) static class RolapResult.CellInfoMap
          Implementation of RolapResult.CellInfoContainer which uses a Map to store CellInfo Objects.
(package private) static class RolapResult.CellInfoPool
          Implementation of RolapResult.CellInfoContainer which uses an ObjectPool to store RolapResult.CellInfo Objects.
(package private) static class RolapResult.FormatValueFormatter
          A FormatValueFormatter takes a Locale as a parameter and uses it to get the Format to be used in formatting an Object value with a given format string.
protected static class RolapResult.RolapResultEvaluatorRoot
          Extension to RolapEvaluatorRoot which is capable of evaluating named sets.

A given set is only evaluated once each time a query is executed; the result is added to the RolapResult.RolapResultEvaluatorRoot.namedSetEvaluators cache on first execution and re-used.

(package private) static interface RolapResult.ValueFormatter
          Formatter to convert values into formatted strings.
 
Field Summary
protected static java.util.Map<CellFormatter,RolapResult.ValueFormatter> cellFormatters
          Synchronized Map from CellFormatter to ValueFormatter.
protected static java.util.Map<java.util.Locale,RolapResult.ValueFormatter> formatValueFormatters
          Synchronized Map from Locale to ValueFormatter.
(package private) static org.apache.log4j.Logger LOGGER
           
 
Fields inherited from class mondrian.olap.ResultBase
axes, query, slicerAxis
 
Constructor Summary
RolapResult(Query query, boolean execute)
          Creates a RolapResult.
 
Method Summary
(package private)  Axis evalExecute(java.util.List<java.util.List<Member>> nonAllMembers, int cnt, RolapEvaluator evaluator, QueryAxis axis, Calc calc)
           
(package private)  void evalLoad(java.util.List<java.util.List<Member>> nonAllMembers, int cnt, Evaluator evaluator, QueryAxis axis, Calc calc, mondrian.rolap.RolapResult.AxisMember axisMembers)
           
(package private)  java.lang.Object evaluateExp(Calc calc, RolapEvaluator evaluator)
          Evaluates an expression.
 Axis[] getAxes()
          Returns the non-slicer axes.
 Cell getCell(int[] pos)
          Get the Cell for the given Cell position.
(package private)  RolapEvaluator getCellEvaluator(int[] pos)
          Called only by RolapCell.
(package private)  RolapMember[] getCellMembers(int[] pos)
          Called only by RolapCell.
(package private)  int getCellOrdinal(int[] pos)
          Converts a set of cell coordinates to a cell ordinal.
 RolapCube getCube()
           
(package private)  Evaluator getEvaluator(int[] pos)
           
protected  org.apache.log4j.Logger getLogger()
           
(package private)  Evaluator getRootEvaluator()
           
(package private)  boolean isDirty()
           
protected  void loadMembers(java.util.List<java.util.List<Member>> nonAllMembers, RolapEvaluator evaluator, QueryAxis axis, Calc calc, mondrian.rolap.RolapResult.AxisMember axisMembers)
           
protected  void loadSpecialMembers(java.util.List<Member> nonDefaultAllMembers, java.util.List<java.util.List<Member>> nonAllMembers, java.util.List<Member> measureMembers)
          Finds all root Members 1) whose Hierarchy does not have an ALL Member, 2) whose default Member is not the ALL Member and 3) all Measures.
protected  void makeModulos()
           
(package private) static Axis mergeAxes(Axis axis1, Axis axis2, RolapEvaluator evaluator, boolean ordered)
           
protected  boolean removeDimension(Dimension dimension, java.util.List<java.util.List<Member>> nonAllMembers)
           
protected  boolean replaceNonAllMembers(java.util.List<java.util.List<Member>> nonAllMembers, mondrian.rolap.RolapResult.AxisMember axisMembers)
           
 
Methods inherited from class mondrian.olap.ResultBase
close, getMember, getQuery, getSlicerAxis, print
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGGER

static final org.apache.log4j.Logger LOGGER

formatValueFormatters

protected static final java.util.Map<java.util.Locale,RolapResult.ValueFormatter> formatValueFormatters
Synchronized Map from Locale to ValueFormatter. It is expected that there will be only a small number of Locale's. Should these be a WeakHashMap?


cellFormatters

protected static final java.util.Map<CellFormatter,RolapResult.ValueFormatter> cellFormatters
Synchronized Map from CellFormatter to ValueFormatter. CellFormatter's are defined in schema files. It is expected the there will only be a small number of CellFormatter's. Should these be a WeakHashMap?

Constructor Detail

RolapResult

RolapResult(Query query,
            boolean execute)
Creates a RolapResult.

Parameters:
query - Query
execute - Whether to execute the query
Method Detail

removeDimension

protected boolean removeDimension(Dimension dimension,
                                  java.util.List<java.util.List<Member>> nonAllMembers)

replaceNonAllMembers

protected boolean replaceNonAllMembers(java.util.List<java.util.List<Member>> nonAllMembers,
                                       mondrian.rolap.RolapResult.AxisMember axisMembers)

loadMembers

protected void loadMembers(java.util.List<java.util.List<Member>> nonAllMembers,
                           RolapEvaluator evaluator,
                           QueryAxis axis,
                           Calc calc,
                           mondrian.rolap.RolapResult.AxisMember axisMembers)

evalLoad

void evalLoad(java.util.List<java.util.List<Member>> nonAllMembers,
              int cnt,
              Evaluator evaluator,
              QueryAxis axis,
              Calc calc,
              mondrian.rolap.RolapResult.AxisMember axisMembers)

evalExecute

Axis evalExecute(java.util.List<java.util.List<Member>> nonAllMembers,
                 int cnt,
                 RolapEvaluator evaluator,
                 QueryAxis axis,
                 Calc calc)

loadSpecialMembers

protected void loadSpecialMembers(java.util.List<Member> nonDefaultAllMembers,
                                  java.util.List<java.util.List<Member>> nonAllMembers,
                                  java.util.List<Member> measureMembers)
Finds all root Members 1) whose Hierarchy does not have an ALL Member, 2) whose default Member is not the ALL Member and 3) all Measures.

Parameters:
nonDefaultAllMembers - List of all root Members for Hierarchies whose default Member is not the ALL Member.
nonAllMembers - List of root Members for Hierarchies that have no ALL Member.
measureMembers - List all Measures

getLogger

protected org.apache.log4j.Logger getLogger()
Specified by:
getLogger in class ResultBase

getCube

public final RolapCube getCube()

getAxes

public Axis[] getAxes()
Description copied from interface: Result
Returns the non-slicer axes.

Specified by:
getAxes in interface Result
Overrides:
getAxes in class ResultBase

getCell

public Cell getCell(int[] pos)
Get the Cell for the given Cell position.

Parameters:
pos - Cell position.
Returns:
the Cell associated with the Cell position.

isDirty

boolean isDirty()

evaluateExp

java.lang.Object evaluateExp(Calc calc,
                             RolapEvaluator evaluator)
Evaluates an expression. Intended for evaluating named sets.

Parameters:
calc - Compiled expression
evaluator - Evaluation context
Returns:
Result

getCellOrdinal

int getCellOrdinal(int[] pos)
Converts a set of cell coordinates to a cell ordinal.

This method can be expensive, because the ordinal is computed from the length of the axes, and therefore the axes need to be instantiated.


makeModulos

protected void makeModulos()

getCellEvaluator

RolapEvaluator getCellEvaluator(int[] pos)
Called only by RolapCell.

Parameters:
pos - Coordinates of cell
Returns:
Evaluator whose context is the given cell

getCellMembers

RolapMember[] getCellMembers(int[] pos)
Called only by RolapCell. Use this when creating an Evaluator (using method getCellEvaluator(int[])) is not required.

Parameters:
pos - Coordinates of cell
Returns:
Members which form the context of the given cell

getRootEvaluator

Evaluator getRootEvaluator()

getEvaluator

Evaluator getEvaluator(int[] pos)

mergeAxes

static Axis mergeAxes(Axis axis1,
                      Axis axis2,
                      RolapEvaluator evaluator,
                      boolean ordered)

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