001    /*
002    // $Id: CellSetMetaData.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) 2006-2008 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    import org.olap4j.metadata.*;
013    
014    import java.sql.ResultSetMetaData;
015    
016    /**
017     * An object that can be used to get information about the axes
018     * and cells in a <code>CellSet</code> object.
019     *
020     * <p>The following code fragment creates the <code>CellSet</code> object cs,
021     * creates the <code>CellSetMetaData</code> object csmd, and uses csmd
022     * to find out how many axes cs has and the name of the cube.
023     *
024     * <blockquote>
025     * <pre>
026     * CellSet cs = stmt.executeOlapQuery(
027     *     "SELECT {[Measures].[Unit Sales] ON COLUMNS,\n" +
028     *     "   Crossjoin([Time].Children, [Store].Children) ON ROWS\n" +
029     *     "FROM [Sales]");
030     * CellSetMetaData csmd = cs.getMetaData();
031     * int numberOfAxes = csmd.getAxesMetaData().size();
032     * String cubeName = csmd.getCube().getName();
033     * </pre>
034     * </blockquote>
035     *
036     * @author jhyde
037     * @version $Id: CellSetMetaData.java 229 2009-05-08 19:11:29Z jhyde $
038     * @since Oct 23, 2006
039     */
040    public interface CellSetMetaData extends ResultSetMetaData, OlapWrapper {
041        /**
042         * Returns a list of Property objects which each Cell may have.
043         *
044         * @return list of cell properties
045         */
046        NamedList<Property> getCellProperties();
047    
048        /**
049         * Returns the Cube which was referenced in this statement.
050         *
051         * @return cube referenced in this statement
052         */
053        Cube getCube();
054    
055        /**
056         * Returns a list of CellSetAxisMetaData describing each result axis.
057         *
058         * @return list of metadata describing each result axis
059         */
060        NamedList<CellSetAxisMetaData> getAxesMetaData();
061    
062        /**
063         * Returns a CellSetAxisMetaData describing the filter axis. Never returns
064         * null; if the MDX statement contains no WHERE clause, the description of
065         * the filter contains no hierarchies.
066         *
067         * @return metadata describing filter axis
068         */
069        CellSetAxisMetaData getFilterAxisMetaData();
070    }
071    
072    // End CellSetMetaData.java