001 /*
002 // $Id: AllocationPolicy.java 482 2012-01-05 23:27:27Z jhyde $
003 //
004 // Licensed to Julian Hyde under one or more contributor license
005 // agreements. See the NOTICE file distributed with this work for
006 // additional information regarding copyright ownership.
007 //
008 // Julian Hyde licenses this file to you under the Apache License,
009 // Version 2.0 (the "License"); you may not use this file except in
010 // compliance with the License. You may obtain a copy of the License at:
011 //
012 // http://www.apache.org/licenses/LICENSE-2.0
013 //
014 // Unless required by applicable law or agreed to in writing, software
015 // distributed under the License is distributed on an "AS IS" BASIS,
016 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017 // See the License for the specific language governing permissions and
018 // limitations under the License.
019 */
020 package org.olap4j;
021
022 /**
023 * Enumeration of the policies that can be used to modify the values of
024 * child cells when their parent cell is modified in a writeback operation.
025 *
026 * @see Cell#setValue
027 *
028 * @author jhyde
029 * @version $Id: AllocationPolicy.java 482 2012-01-05 23:27:27Z jhyde $
030 * @since Aug 22, 2006
031 */
032 public enum AllocationPolicy {
033 /**
034 * Every atomic cell that contributes to the updated cell will be
035 * assigned an equal value that is:
036 *
037 * <blockquote>
038 * <atomic cell value> =
039 * <value> / Count(atomic cells contained in <tuple>)
040 * </blockquote>
041 */
042 EQUAL_ALLOCATION,
043
044 /**
045 * Every atomic cell that contributes to the updated cell will be
046 * changed according to:
047 *
048 * <blockquote>
049 * <atomic cell value> = <atomic cell value> +
050 * (<value> - <existing value>) /
051 * Count(atomic cells contained in <tuple>)
052 * </blockquote>
053 */
054 EQUAL_INCREMENT,
055
056 /**
057 * Every atomic cell that contributes to the updated cell will be
058 * assigned an equal value that is:
059 *
060 * <blockquote>
061 * <atomic cell value> =
062 * <value> * <weight value expression>
063 * </blockquote>
064 *
065 * <p>Takes an optional argument, {@code weight_value_expression}.
066 * If {@code weight_value_expression} is not provided, the following
067 * expression is assigned to it by default:
068 *
069 * <blockquote>
070 * <weight value expression> =
071 * <atomic cell value> / <existing value>
072 * <blockquote>
073 *
074 * <p>The value of {@code weight value expression} should be expressed
075 * as a value between 0 and 1. This value specifies the ratio of the
076 * allocated value you want to assign to the atomic cells that are
077 * affected by the allocation. It is the client application programmer's
078 * responsibilffity to create expressions whose rollup aggregate values
079 * will equal the allocated value of the expression.
080 */
081 WEIGHTED_ALLOCATION,
082
083 /**
084 * Every atomic cell that contributes to the updated cell will be
085 * changed according to:
086 *
087 * <blockquote>
088 * <atomic cell value> = <atomic cell value> +
089 * (<value> - <existing value>) *
090 * <weight value expression>
091 * </blockquote>
092 *
093 * <p>Takes an optional argument, {@code weight_value_expression}.
094 * If {@code weight_value_expression} is not provided, the following
095 * expression is assigned to it by default:
096 *
097 * <blockquote>
098 * <weight value expression> =
099 * <atomic cell value> / <existing value>
100 * <blockquote>
101 *
102 * <p>The value of {@code weight value expression} should be expressed
103 * as a value between 0 and 1. This value specifies the ratio of the
104 * allocated value you want to assign to the atomic cells that are
105 * affected by the allocation. It is the client application programmer's
106 * responsibility to create expressions whose rollup aggregate values
107 * will equal the allocated value of the expression.
108 */
109 WEIGHTED_INCREMENT,
110 }
111
112 // End AllocationPolicy.java