KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tonbeller > jpivot > olap > navi > CalcSet


1 /*
2  * ====================================================================
3  * This software is subject to the terms of the Common Public License
4  * Agreement, available at the following URL:
5  * http://www.opensource.org/licenses/cpl.html .
6  * Copyright (C) 2003-2004 TONBELLER AG.
7  * All Rights Reserved.
8  * You must accept the terms of that agreement to use this software.
9  * ====================================================================
10  *
11  *
12  */

13 package com.tonbeller.jpivot.olap.navi;
14
15 import com.tonbeller.jpivot.core.Extension;
16 import com.tonbeller.jpivot.olap.model.Expression;
17 import com.tonbeller.jpivot.olap.model.Hierarchy;
18
19 /**
20  * @author av
21  */

22
23 public interface CalcSet extends Extension {
24
25   public static final String JavaDoc ID = "calcSet";
26
27   /**
28    * evaluates the expression once in global context.
29    * <p>
30    * Example: create an expression for customer, e.g. TopCount
31    * <pre>
32    * Products Customer
33    * A TopCount(Customer.members, 5)
34    * B
35    * C
36    * </pre>
37    * <p>
38    * SIMPLE will find the top 5 customers globally and will display
39    * the same 5 customers for every product
40    */

41   public static final int SIMPLE = 0;
42   
43   /**
44    * in case of multiple hierarchies on an axis, the expression
45    * is evaluated for every member of the hierarchies, that are
46    * left of this hierarchy.
47    * <p>
48    * Example: create an expression for customer, e.g. TopCount
49    * <pre>
50    * Products Customer
51    * A TopCount(Customer.members, 5)
52    * B
53    * C
54    * </pre>
55    * <p>
56    * GENERATE will find the top 5 customers for every product, it will
57    * show different customers for every product.
58    */

59   public static final int GENERATE = 1;
60
61   /**
62    * Expression is re-evaluated when the user navigates.
63    * Navigation is restricted.
64    */

65   public static final int STICKY = 2;
66
67   /**
68    * creates an Object that may be placed on an axis via
69    * PlaceHierarchiesOnAxes.
70    *
71    * @param mode one of SIMPLE, GENERATE, STICKY
72    *
73    * @param expr the Expression to parse
74    *
75    * @param hier the Hierarchy that the expression evaluates to
76    *
77    * @return the object to place on the axis
78    * @throws InvalidExpressionException in case the expression is not valid,
79    * e.g. misspelled function names etc
80    * @see com.tonbeller.jpivot.olap.navi.PlaceHierarchiesOnAxes#setQueryAxis
81    */

82   Object JavaDoc createAxisExpression(int mode, Expression expr, Hierarchy hier) throws InvalidExpressionException;
83
84 }
85
Popular Tags