001    /*
002    // $Id: //open/mondrian-release/3.2/src/main/mondrian/olap/Cube.java#1 $
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) 1999-2002 Kana Software, Inc.
007    // Copyright (C) 2001-2009 Julian Hyde and others
008    // All Rights Reserved.
009    // You must accept the terms of that agreement to use this software.
010    //
011    // jhyde, 2 March, 1999
012    */
013    
014    package mondrian.olap;
015    
016    import java.util.*;
017    
018    /**
019     * Cube.
020     *
021     * @version $Id: //open/mondrian-release/3.2/src/main/mondrian/olap/Cube.java#1 $
022     * @author jhyde
023     */
024    public interface Cube extends OlapElement, Annotated {
025    
026        String getName();
027    
028        Schema getSchema();
029    
030        /**
031         * Returns the dimensions of this cube.
032         */
033        Dimension[] getDimensions();
034    
035        /**
036         * Returns the named sets of this cube.
037         */
038        NamedSet[] getNamedSets();
039    
040        /**
041         * Finds a hierarchy whose name (or unique name, if <code>unique</code> is
042         * true) equals <code>s</code>.
043         */
044        Hierarchy lookupHierarchy(Id.Segment s, boolean unique);
045    
046        /**
047         * Returns Member[]. It builds Member[] by analyzing cellset, which
048         * gets created by running mdx sQuery.  <code>query</code> has to be in the
049         * format of something like "[with calculated members] select *members* on
050         * columns from <code>this</code>".
051         */
052        Member[] getMembersForQuery(String query, List<Member> calcMembers);
053    
054        /**
055         * Helper method that returns the Year Level or returns null if the Time
056         * Dimension does not exist or if Year is not defined in the Time Dimension.
057         *
058         * @return Level or null.
059         */
060        Level getYearLevel();
061    
062        /**
063         * Return Quarter Level or null.
064         *
065         * @return Quarter Level or null.
066         */
067        Level getQuarterLevel();
068    
069        /**
070         * Return Month Level or null.
071         *
072         * @return Month Level or null.
073         */
074        Level getMonthLevel();
075    
076        /**
077         * Return Week Level or null.
078         *
079         * @return Week Level or null.
080         */
081        Level getWeekLevel();
082    
083        /**
084         * Returns a {@link SchemaReader} for which this cube is the context for
085         * lookup up members.
086         * If <code>role</code> is null, the returned schema reader also obeys the
087         * access-control profile of role.
088         */
089        SchemaReader getSchemaReader(Role role);
090    
091        /**
092         * Creates a calculated member in this cube.
093         *
094         * <p>The XML string must be a <code>&lt;CalculatedMember/&gt;</code>
095         * element, as defined in <code>Mondrian.xml</code>.
096         *
097         * @param xml XML string
098         */
099        Member createCalculatedMember(String xml);
100    
101        /**
102         * Finds out non joining dimensions for this cube.
103         *
104         * @param tuple array of members
105         * @return Set of dimensions that do not exist (non joining) in this cube
106         */
107        Set<Dimension> nonJoiningDimensions(Member[] tuple);
108    
109        /**
110         * Finds out non joining dimensions for this cube.
111         *
112         * @param otherDims Set of dimensions to be tested for existence
113         *     in this cube
114         * @return Set of dimensions that do not exist (non joining) in this cube
115         */
116        Set<Dimension> nonJoiningDimensions(Set<Dimension> otherDims);
117    }
118    
119    // End Cube.java