KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > mondrian > olap > Cell


1 /*
2 // $Id: //open/mondrian/src/main/mondrian/olap/Cell.java#14 $
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) 2001-2002 Kana Software, Inc.
7 // Copyright (C) 2001-2006 Julian Hyde and others
8 // All Rights Reserved.
9 // You must accept the terms of that agreement to use this software.
10 //
11 // jhyde, 6 August, 2001
12 */

13
14 package mondrian.olap;
15
16 /**
17  * A <code>Cell</code> is an item in the grid of a {@link Result}. It is
18  * returned by {@link Result#getCell}.
19  *
20  * @author jhyde
21  * @since 6 August, 2001
22  * @version $Id: //open/mondrian/src/main/mondrian/olap/Cell.java#14 $
23  */

24 public interface Cell {
25     /**
26      * Returns the cell's raw value. This is useful for sending to further data
27      * processing, such as plotting a chart.
28      *
29      * <p> The value is never null. It may have various types:<ul>
30      * <li>if the cell is null, the value is {@link Util#nullValue};</li>
31      * <li>if the cell contains an error, the value is an instance of
32      * {@link Throwable};</li>
33      * <li>otherwise, the type of this value depends upon the type of
34      * measure: possible types include {@link java.math.BigDecimal},
35      * {@link Double}, {@link Integer} and {@link String}.</li>
36      * </ul>
37      *
38      * @post return != null
39      * @post (return instanceof Throwable) == isError()
40      * @post (return instanceof Util.NullCellValue) == isNull()
41      */

42     Object JavaDoc getValue();
43
44
45     /**
46      * Return the cached formatted string, that survives an aggregate cache clear
47      */

48     String JavaDoc getCachedFormatString();
49
50     /**
51      * Returns the cell's value formatted according to the current format
52      * string, and locale-specific settings such as currency symbol. The
53      * current format string may itself be derived via an expression. For more
54      * information about format strings, see {@link mondrian.util.Format}.
55      */

56     String JavaDoc getFormattedValue();
57
58     /**
59      * Returns whether the cell's value is null.
60      */

61     boolean isNull();
62
63     /**
64      * Returns whether the cell's calculation returned an error.
65      */

66     boolean isError();
67
68     /**
69      * Returns a SQL query that, when executed, returns drill through data
70      * for this Cell.
71      * If the parameter extendedContext is true, then the
72      * query will include all the levels (i.e. columns) of non-constraining members
73      * (i.e. members which are at the "All" level).
74      * If the parameter extendedContext is false, the query will exclude
75      * the levels (coulmns) of non-constraining members.
76      * The result is null if the cell is based upon a calculated member.
77      *
78      */

79     String JavaDoc getDrillThroughSQL(boolean extendedContext);
80
81     /**
82      * Returns true if drill through is possible for this Cell.
83      * Returns false if the Cell is based on a calculated measure.
84      * @return true if can drill through on this cell
85      */

86     boolean canDrillThrough();
87
88     /**
89      * Returns the number of fact table rows which contributed to this Cell.
90      */

91     int getDrillThroughCount();
92
93     /**
94      * Returns the value of a property.
95      *
96      * @param propertyName Case-sensitive property name
97      * @return Value of property
98      */

99     Object JavaDoc getPropertyValue(String JavaDoc propertyName);
100
101     /**
102      * Returns the context member for a particular dimension.
103      *
104      * The member is defined as follows (note that there is always a
105      * member):<ul>
106      *
107      * <li>If the dimension appears on one of the visible axes, the context
108      * member is simply the member on the current row or column.
109      *
110      * <li>If the dimension appears in the slicer, the context member is the
111      * member of that dimension in the slier.
112      *
113      * <li>Otherwise, the context member is the default member of that
114      * dimension (usually the 'all' member).</ul>
115      */

116     Member getContextMember(Dimension dimension);
117 }
118
119 // End Cell.java
120
Popular Tags