KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > mondrian > rolap > CellReader


1 /*
2 // $Id: //open/mondrian/src/main/mondrian/rolap/CellReader.java#9 $
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, 10 August, 2001
12 */

13
14 package mondrian.rolap;
15 import mondrian.olap.Evaluator;
16 import mondrian.olap.Util;
17
18 /**
19  * A <code>CellReader</code> finds the cell value for the current context
20  * held by <code>evaluator</code>.
21  *
22  * <p>It returns:<ul>
23  * <li><code>null</code> if the source is unable to evaluate the cell (for
24  * example, <code>AggregatingCellReader</code> does not have the cell
25  * in its cache). This value should only be returned if the caller is
26  * expecting it.</li>
27  * <li>{@link Util#nullValue} if the cell evaluates to null</li>
28  * <li>{@link mondrian.olap.Util.ErrorCellValue} if the cell evaluates to an
29  * error</li>
30  * <li>an Object representing a value (often a {@link Double} or a {@link
31  * java.math.BigDecimal}), otherwise</li>
32  * </ul>
33  *
34  * @author jhyde
35  * @since 10 August, 2001
36  * @version $Id: //open/mondrian/src/main/mondrian/rolap/CellReader.java#9 $
37  */

38 interface CellReader {
39     /**
40      * Returns the value of the cell which has the context described by the
41      * evaluator.
42      *
43      * <p>If no aggregation contains the required cell, returns null.
44      *
45      * <p>If the value is null, returns {@link Util#nullValue}.
46      */

47     Object JavaDoc get(Evaluator evaluator);
48
49     /**
50      * Returns the number of times this cell reader has told a lie because the
51      * required cell value is not in the cache.
52      */

53     int getMissCount();
54 }
55
56 // End CellReader.java
57
Popular Tags