001 /*
002 // $Id: Cell.java 229 2009-05-08 19:11:29Z jhyde $
003 // This software is subject to the terms of the Eclipse Public License v1.0
004 // Agreement, available at the following URL:
005 // http://www.eclipse.org/legal/epl-v10.html.
006 // Copyright (C) 2009-2009 Julian Hyde
007 // All Rights Reserved.
008 // You must accept the terms of that agreement to use this software.
009 */
010 package org.olap4j;
011
012 /**
013 * Enumeration of the policies that can be used to modify the values of
014 * child cells when their parent cell is modified in a writeback operation.
015 *
016 * @see Cell#setValue
017 *
018 * @author jhyde
019 * @version $Id: Cell.java 229 2009-05-08 19:11:29Z jhyde $
020 * @since Aug 22, 2006
021 */
022 public enum AllocationPolicy {
023 /**
024 * Every atomic cell that contributes to the updated cell will be
025 * assigned an equal value that is:
026 *
027 * <blockquote>
028 * <atomic cell value> =
029 * <value> / Count(atomic cells contained in <tuple>)
030 * </blockquote>
031 */
032 EQUAL_ALLOCATION,
033
034 /**
035 * Every atomic cell that contributes to the updated cell will be
036 * changed according to:
037 *
038 * <blockquote>
039 * <atomic cell value> = <atomic cell value> +
040 * (<value> - <existing value>) /
041 * Count(atomic cells contained in <tuple>)
042 * </blockquote>
043 */
044 EQUAL_INCREMENT,
045
046 /**
047 * Every atomic cell that contributes to the updated cell will be
048 * assigned an equal value that is:
049 *
050 * <blockquote>
051 * <atomic cell value> =
052 * <value> * <weight value expression>
053 * </blockquote>
054 *
055 * <p>Takes an optional argument, {@code weight_value_expression}.
056 * If {@code weight_value_expression} is not provided, the following
057 * expression is assigned to it by default:
058 *
059 * <blockquote>
060 * <weight value expression> =
061 * <atomic cell value> / <existing value>
062 * <blockquote>
063 *
064 * <p>The value of {@code weight value expression} should be expressed
065 * as a value between 0 and 1. This value specifies the ratio of the
066 * allocated value you want to assign to the atomic cells that are
067 * affected by the allocation. It is the client application programmer's
068 * responsibilffity to create expressions whose rollup aggregate values
069 * will equal the allocated value of the expression.
070 */
071 WEIGHTED_ALLOCATION,
072
073 /**
074 * Every atomic cell that contributes to the updated cell will be
075 * changed according to:
076 *
077 * <blockquote>
078 * <atomic cell value> = <atomic cell value> +
079 * (<value> - <existing value>) *
080 * <weight value expression>
081 * </blockquote>
082 *
083 * <p>Takes an optional argument, {@code weight_value_expression}.
084 * If {@code weight_value_expression} is not provided, the following
085 * expression is assigned to it by default:
086 *
087 * <blockquote>
088 * <weight value expression> =
089 * <atomic cell value> / <existing value>
090 * <blockquote>
091 *
092 * <p>The value of {@code weight value expression} should be expressed
093 * as a value between 0 and 1. This value specifies the ratio of the
094 * allocated value you want to assign to the atomic cells that are
095 * affected by the allocation. It is the client application programmer's
096 * responsibility to create expressions whose rollup aggregate values
097 * will equal the allocated value of the expression.
098 */
099 WEIGHTED_INCREMENT,
100 }
101
102 // End AllocationPolicy.java