001    /*
002    // $Id: //open/mondrian-release/3.2/src/main/mondrian/olap/Hierarchy.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.Map;
017    
018    /**
019     * A <code>Hierarchy</code> is a set of members, organized into levels.
020     */
021    public interface Hierarchy extends OlapElement, Annotated {
022        /**
023         * Returns the dimension this hierarchy belongs to.
024         */
025        Dimension getDimension();
026        /**
027         * Returns the levels in this hierarchy.
028         *
029         * <p>If a hierarchy is subject to access-control, some of the levels may
030         * not be visible; use {@link SchemaReader#getHierarchyLevels} instead.
031         *
032         * @post return != null
033         */
034        Level[] getLevels();
035        /**
036         * Returns the default member of this hierarchy.
037         *
038         * <p>If a hierarchy is subject to access-control, the default member may
039         * not be visible, so use {@link SchemaReader#getHierarchyDefaultMember}.
040         *
041         * @post return != null
042         */
043        Member getDefaultMember();
044        /**
045         * Returns the "All" member of this hierarchy.
046         *
047         * @post return != null
048         */
049        Member getAllMember();
050        /**
051         * Returns a special member representing the "null" value. This never
052         * occurs on an axis, but may occur if functions such as <code>Lead</code>,
053         * <code>NextMember</code> and <code>ParentMember</code> walk off the end
054         * of the hierarchy.
055         *
056         * @post return != null
057         */
058        Member getNullMember();
059    
060        boolean hasAll();
061    
062        /**
063         * Creates a member of this hierarchy. If this is the measures hierarchy, a
064         * calculated member is created, and <code>formula</code> must not be null.
065         */
066        Member createMember(
067            Member parent, Level level, String name, Formula formula);
068    }
069    
070    // End Hierarchy.java