Class ScenarioImpl

  • All Implemented Interfaces:
    Scenario

    public final class ScenarioImpl
    extends java.lang.Object
    implements Scenario
    Implementation of Scenario.
    Since:
    24 April, 2009
    Author:
    jhyde
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      (package private) static class  ScenarioImpl.CellRelation
      Decribes the relationship between two cells.
    • Constructor Summary

      Constructors 
      Constructor Description
      ScenarioImpl()
      Creates a ScenarioImpl.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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()  
      RolapMember getMember()
      Returns the member of the [Scenario] dimension that represents this scenario.
      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:
        connection - Connection (not currently used)
        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
      • getMember

        public RolapMember getMember()
        Returns the member of the [Scenario] dimension that represents this scenario. Including that member in the slicer will automatically use this scenario.

        The result is not null, provided that register(RolapSchema) has been called.

        Returns:
        Scenario member