forked from olap4j/olap4j
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add writeback API (Scenario, AllocationPolicy).
Fix some references broken by the CellSetFormatter move. git-svn-id: https://olap4j.svn.sourceforge.net/svnroot/olap4j/trunk@282 c6a108a4-781c-0410-a6c6-c2d559e19af0
- Loading branch information
1 parent
8e541bb
commit 24050d7
Showing
8 changed files
with
231 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
/* | ||
// $Id: Cell.java 229 2009-05-08 19:11:29Z jhyde $ | ||
// This software is subject to the terms of the Eclipse Public License v1.0 | ||
// Agreement, available at the following URL: | ||
// http://www.eclipse.org/legal/epl-v10.html. | ||
// Copyright (C) 2009-2009 Julian Hyde | ||
// All Rights Reserved. | ||
// You must accept the terms of that agreement to use this software. | ||
*/ | ||
package org.olap4j; | ||
|
||
/** | ||
* Enumeration of the policies that can be used to modify the values of | ||
* child cells when their parent cell is modified in a writeback operation. | ||
* | ||
* @see Cell#setValue | ||
* | ||
* @author jhyde | ||
* @version $Id: Cell.java 229 2009-05-08 19:11:29Z jhyde $ | ||
* @since Aug 22, 2006 | ||
*/ | ||
public enum AllocationPolicy { | ||
/** | ||
* Every atomic cell that contributes to the updated cell will be | ||
* assigned an equal value that is: | ||
* | ||
* <blockquote> | ||
* <atomic cell value> = | ||
* <value> / Count(atomic cells contained in <tuple>) | ||
* </blockquote> | ||
*/ | ||
EQUAL_ALLOCATION, | ||
|
||
/** | ||
* Every atomic cell that contributes to the updated cell will be | ||
* changed according to: | ||
* | ||
* <blockquote> | ||
* <atomic cell value> = <atomic cell value> + | ||
* (<value> - <existing value>) / | ||
* Count(atomic cells contained in <tuple>) | ||
* </blockquote> | ||
*/ | ||
EQUAL_INCREMENT, | ||
|
||
/** | ||
* Every atomic cell that contributes to the updated cell will be | ||
* assigned an equal value that is: | ||
* | ||
* <blockquote> | ||
* <atomic cell value> = | ||
* <value> * <weight value expression> | ||
* </blockquote> | ||
* | ||
* <p>Takes an optional argument, {@code weight_value_expression}. | ||
* If {@code weight_value_expression} is not provided, the following | ||
* expression is assigned to it by default: | ||
* | ||
* <blockquote> | ||
* <weight value expression> = | ||
* <atomic cell value> / <existing value> | ||
* <blockquote> | ||
* | ||
* <p>The value of {@code weight value expression} should be expressed | ||
* as a value between 0 and 1. This value specifies the ratio of the | ||
* allocated value you want to assign to the atomic cells that are | ||
* affected by the allocation. It is the client application programmer's | ||
* responsibilffity to create expressions whose rollup aggregate values | ||
* will equal the allocated value of the expression. | ||
*/ | ||
WEIGHTED_ALLOCATION, | ||
|
||
/** | ||
* Every atomic cell that contributes to the updated cell will be | ||
* changed according to: | ||
* | ||
* <blockquote> | ||
* <atomic cell value> = <atomic cell value> + | ||
* (<value> - <existing value>) * | ||
* <weight value expression> | ||
* </blockquote> | ||
* | ||
* <p>Takes an optional argument, {@code weight_value_expression}. | ||
* If {@code weight_value_expression} is not provided, the following | ||
* expression is assigned to it by default: | ||
* | ||
* <blockquote> | ||
* <weight value expression> = | ||
* <atomic cell value> / <existing value> | ||
* <blockquote> | ||
* | ||
* <p>The value of {@code weight value expression} should be expressed | ||
* as a value between 0 and 1. This value specifies the ratio of the | ||
* allocated value you want to assign to the atomic cells that are | ||
* affected by the allocation. It is the client application programmer's | ||
* responsibility to create expressions whose rollup aggregate values | ||
* will equal the allocated value of the expression. | ||
*/ | ||
WEIGHTED_INCREMENT, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
// $Id: //open/mondrian/src/main/mondrian/olap/Scenario.java#4 $ | ||
// This software is subject to the terms of the Eclipse Public License v1.0 | ||
// Agreement, available at the following URL: | ||
// http://www.eclipse.org/legal/epl-v10.html. | ||
// Copyright (C) 2009-2009 Julian Hyde and others | ||
// All Rights Reserved. | ||
// You must accept the terms of that agreement to use this software. | ||
*/ | ||
package org.olap4j; | ||
|
||
/** | ||
* Context for a set of writeback operations. | ||
* | ||
* <p>An analyst performing a what-if analysis would first create a scenario, | ||
* or open an existing scenario, then modify a sequence of cell values. | ||
* | ||
* <p>Some OLAP engines allow scenarios to be saved (to a file, or perhaps to | ||
* the database) and restored in a future session. | ||
* | ||
* <p>Multiple scenarios may be open at the same time, by different users of | ||
* the OLAP engine. | ||
* | ||
* @see OlapConnection#createScenario() | ||
* @see OlapConnection#setScenario(Scenario) | ||
* @see OlapConnection#getScenario() | ||
* @see Cell#setValue(Object, AllocationPolicy, Object[]) | ||
* @see AllocationPolicy | ||
* | ||
* @author jhyde | ||
* @since 24 April, 2009 | ||
* @version $Id: //open/mondrian/src/main/mondrian/olap/Scenario.java#4 $ | ||
*/ | ||
public interface Scenario { | ||
/** | ||
* Returns the unique identifier of this Scenario. | ||
* | ||
* <p>The format of the string returned is implementation defined. Client | ||
* applications must not make any assumptions about the structure or | ||
* contents of such strings. | ||
* | ||
* @return Unique identifier of this Scenario. | ||
*/ | ||
String getId(); | ||
} | ||
|
||
// End Scenario.java |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters