001/*
002// This software is subject to the terms of the Eclipse Public License v1.0
003// Agreement, available at the following URL:
004// http://www.eclipse.org/legal/epl-v10.html.
005// You must accept the terms of that agreement to use this software.
006//
007// Copyright (C) 1999-2005 Julian Hyde
008// Copyright (C) 2005-2011 Pentaho and others
009// All Rights Reserved.
010*/
011package mondrian.olap;
012
013/**
014 * A <code>Hierarchy</code> is a set of members, organized into levels.
015 */
016public interface Hierarchy extends OlapElement, Annotated {
017    /**
018     * Returns the dimension this hierarchy belongs to.
019     */
020    Dimension getDimension();
021    /**
022     * Returns the levels in this hierarchy.
023     *
024     * <p>If a hierarchy is subject to access-control, some of the levels may
025     * not be visible; use {@link SchemaReader#getHierarchyLevels} instead.
026     *
027     * @post return != null
028     */
029    Level[] getLevels();
030    /**
031     * Returns the default member of this hierarchy.
032     *
033     * <p>If a hierarchy is subject to access-control, the default member may
034     * not be visible, so use {@link SchemaReader#getHierarchyDefaultMember}.
035     *
036     * @post return != null
037     */
038    Member getDefaultMember();
039    /**
040     * Returns the "All" member of this hierarchy.
041     *
042     * @post return != null
043     */
044    Member getAllMember();
045    /**
046     * Returns a special member representing the "null" value. This never
047     * occurs on an axis, but may occur if functions such as <code>Lead</code>,
048     * <code>NextMember</code> and <code>ParentMember</code> walk off the end
049     * of the hierarchy.
050     *
051     * @post return != null
052     */
053    Member getNullMember();
054
055    boolean hasAll();
056
057    /**
058     * Creates a member of this hierarchy. If this is the measures hierarchy, a
059     * calculated member is created, and <code>formula</code> must not be null.
060     */
061    Member createMember(
062        Member parent, Level level, String name, Formula formula);
063
064    /**
065     * Returns the unique name of this hierarchy, always including the dimension
066     * name, e.g. "[Time].[Time]", regardless of whether
067     * {@link MondrianProperties#SsasCompatibleNaming} is enabled.
068     *
069     * @deprecated Will be removed in mondrian-4.0, when
070     * {@link #getUniqueName()} will have this behavior.
071     *
072     * @return Unique name of hierarchy.
073     */
074    String getUniqueNameSsas();
075}
076
077// End Hierarchy.java