001    /*
002    // $Id: //open/mondrian/src/main/mondrian/olap/OlapElement.java#17 $
003    // This software is subject to the terms of the Common Public License
004    // Agreement, available at the following URL:
005    // http://www.opensource.org/licenses/cpl.html.
006    // Copyright (C) 1998-2002 Kana Software, Inc.
007    // Copyright (C) 2001-2007 Julian Hyde and others
008    // All Rights Reserved.
009    // You must accept the terms of that agreement to use this software.
010    //
011    // jhyde, 21 January, 1999
012    */
013    
014    package mondrian.olap;
015    
016    /**
017     * An <code>OlapElement</code> is a catalog object (dimension, hierarchy,
018     * level, member).
019     */
020    public interface OlapElement {
021        String getUniqueName();
022        String getName();
023        String getDescription();
024    
025        /**
026         * Looks up a child element, returning null if it does not exist.
027         */
028        OlapElement lookupChild(SchemaReader schemaReader, Id.Segment s);
029        OlapElement lookupChild(
030            SchemaReader schemaReader, Id.Segment s, MatchType matchType);
031    
032        /**
033         * Returns the name of this element qualified by its class, for example
034         * "hierarchy 'Customers'".
035         */
036        String getQualifiedName();
037    
038        String getCaption();
039        Hierarchy getHierarchy();
040    
041        /**
042         * Returns the dimension of a this expression, or null if no dimension is
043         * defined. Applicable only to set expressions.
044         *
045         * <p>Example 1:
046         * <blockquote><pre>
047         * [Sales].children
048         * </pre></blockquote>
049         * has dimension <code>[Sales]</code>.</p>
050         *
051         * <p>Example 2:
052         * <blockquote><pre>
053         * order(except([Promotion Media].[Media Type].members,
054         *              {[Promotion Media].[Media Type].[No Media]}),
055         *       [Measures].[Unit Sales], DESC)
056         * </pre></blockquote>
057         * has dimension [Promotion Media].</p>
058         *
059         * <p>Example 3:
060         * <blockquote><pre>
061         * CrossJoin([Product].[Product Department].members,
062         *           [Gender].members)
063         * </pre></blockquote>
064         * has no dimension (well, actually it is [Product] x [Gender], but we
065         * can't represent that, so we return null);</p>
066         */
067        Dimension getDimension();
068    }
069    
070    // End OlapElement.java