mondrian.rolap
Class ScenarioImpl

java.lang.Object
  extended by mondrian.rolap.ScenarioImpl
All Implemented Interfaces:
Scenario

public final class ScenarioImpl
extends java.lang.Object
implements Scenario

Implementation of Scenario.

Since:
24 April, 2009
Version:
$Id: //open/mondrian/src/main/mondrian/rolap/ScenarioImpl.java#5 $
Author:
jhyde

Nested Class Summary
(package private) static class ScenarioImpl.CellRelation
          Decribes the relationship between two cells.
 
Constructor Summary
ScenarioImpl()
          Creates a ScenarioImpl.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
(package private) static Scenario forMember(RolapMember member)
          Returns the scenario inside a calculated member in the scenario dimension.
 java.lang.String getId()
           
 int hashCode()
           
static boolean isScenario(Hierarchy hierarchy)
          Returns whether a hierarchy is the [Scenario] hierarchy.
(package private)  void register(RolapSchema schema)
          Registers this Scenario with a Schema, creating a calulated member [Scenario].[{id}] for each cube that has writeback enabled.
 void setCellValue(Connection connection, java.util.List<RolapMember> members, double newValue, double currentValue, AllocationPolicy allocationPolicy, java.lang.Object[] allocationArgs)
          Sets the value of a cell.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ScenarioImpl

public ScenarioImpl()
Creates a ScenarioImpl.

Method Detail

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

setCellValue

public void setCellValue(Connection connection,
                         java.util.List<RolapMember> members,
                         double newValue,
                         double currentValue,
                         AllocationPolicy allocationPolicy,
                         java.lang.Object[] allocationArgs)
Sets the value of a cell.

Parameters:
members - Coordinates of cell
newValue - New value
currentValue - Current value
allocationPolicy - Allocation policy
allocationArgs - Additional arguments of allocation policy

getId

public java.lang.String getId()
Specified by:
getId in interface Scenario

forMember

static Scenario forMember(RolapMember member)
Returns the scenario inside a calculated member in the scenario dimension. For example, applied to [Scenario].[1], returns the Scenario object representing scenario #1.

Parameters:
member - Wrapper member
Returns:
Wrapped scenario

register

void register(RolapSchema schema)
Registers this Scenario with a Schema, creating a calulated member [Scenario].[{id}] for each cube that has writeback enabled. (Currently a cube has writeback enabled iff it has a dimension called "Scenario".)

Parameters:
schema - Schema

isScenario

public static boolean isScenario(Hierarchy hierarchy)
Returns whether a hierarchy is the [Scenario] hierarchy.

TODO: use a flag

Parameters:
hierarchy - Hierarchy
Returns:
Whether hierarchy is the scenario hierarchy

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