001/*
002// Licensed to Julian Hyde under one or more contributor license
003// agreements. See the NOTICE file distributed with this work for
004// additional information regarding copyright ownership.
005//
006// Julian Hyde licenses this file to you under the Apache License,
007// Version 2.0 (the "License"); you may not use this file except in
008// compliance with the License. You may obtain a copy of the License at:
009//
010// http://www.apache.org/licenses/LICENSE-2.0
011//
012// Unless required by applicable law or agreed to in writing, software
013// distributed under the License is distributed on an "AS IS" BASIS,
014// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015// See the License for the specific language governing permissions and
016// limitations under the License.
017*/
018package org.olap4j;
019
020import org.olap4j.metadata.*;
021
022import java.sql.ResultSetMetaData;
023
024/**
025 * An object that can be used to get information about the axes
026 * and cells in a <code>CellSet</code> object.
027 *
028 * <p>The following code fragment creates the <code>CellSet</code> object cs,
029 * creates the <code>CellSetMetaData</code> object csmd, and uses csmd
030 * to find out how many axes cs has and the name of the cube.
031 *
032 * <blockquote>
033 * <pre>
034 * CellSet cs = stmt.executeOlapQuery(
035 *     "SELECT {[Measures].[Unit Sales] ON COLUMNS,\n" +
036 *     "   Crossjoin([Time].Children, [Store].Children) ON ROWS\n" +
037 *     "FROM [Sales]");
038 * CellSetMetaData csmd = cs.getMetaData();
039 * int numberOfAxes = csmd.getAxesMetaData().size();
040 * String cubeName = csmd.getCube().getName();
041 * </pre>
042 * </blockquote>
043 *
044 * @author jhyde
045 * @since Oct 23, 2006
046 */
047public interface CellSetMetaData extends ResultSetMetaData, OlapWrapper {
048    /**
049     * Returns a list of Property objects which each Cell may have.
050     *
051     * @return list of cell properties
052     */
053    NamedList<Property> getCellProperties();
054
055    /**
056     * Returns the Cube which was referenced in this statement.
057     *
058     * @return cube referenced in this statement
059     */
060    Cube getCube();
061
062    /**
063     * Returns a list of CellSetAxisMetaData describing each result axis.
064     *
065     * @return list of metadata describing each result axis
066     */
067    NamedList<CellSetAxisMetaData> getAxesMetaData();
068
069    /**
070     * Returns a CellSetAxisMetaData describing the filter axis. Never returns
071     * null; if the MDX statement contains no WHERE clause, the description of
072     * the filter contains no hierarchies.
073     *
074     * @return metadata describing filter axis
075     */
076    CellSetAxisMetaData getFilterAxisMetaData();
077}
078
079// End CellSetMetaData.java