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