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) 2004-2005 Julian Hyde
008// Copyright (C) 2005-2011 Pentaho
009// All Rights Reserved.
010*/
011package mondrian.olap;
012
013/**
014 * Enumerates the types of levels.
015 *
016 * @deprecated Will be replaced with {@link org.olap4j.metadata.Level.Type}
017 * before mondrian-4.0.
018 *
019 * @author jhyde
020 * @since 5 April, 2004
021 */
022public enum LevelType {
023
024    /** Indicates that the level is not related to time. */
025    Regular,
026
027    /**
028     * Indicates that a level refers to years.
029     * It must be used in a dimension whose type is
030     * {@link DimensionType#TimeDimension}.
031     */
032    TimeYears,
033
034    /**
035     * Indicates that a level refers to half years.
036     * It must be used in a dimension whose type is
037     * {@link DimensionType#TimeDimension}.
038     */
039    TimeHalfYears,
040
041    /**
042     * Indicates that a level refers to quarters.
043     * It must be used in a dimension whose type is
044     * {@link DimensionType#TimeDimension}.
045     */
046    TimeQuarters,
047
048    /**
049     * Indicates that a level refers to months.
050     * It must be used in a dimension whose type is
051     * {@link DimensionType#TimeDimension}.
052     */
053    TimeMonths,
054
055    /**
056     * Indicates that a level refers to weeks.
057     * It must be used in a dimension whose type is
058     * {@link DimensionType#TimeDimension}.
059     */
060    TimeWeeks,
061
062    /**
063     * Indicates that a level refers to days.
064     * It must be used in a dimension whose type is
065     * {@link DimensionType#TimeDimension}.
066     */
067    TimeDays,
068
069    /**
070     * Indicates that a level refers to hours.
071     * It must be used in a dimension whose type is
072     * {@link DimensionType#TimeDimension}.
073     */
074    TimeHours,
075
076    /**
077     * Indicates that a level refers to minutes.
078     * It must be used in a dimension whose type is
079     * {@link DimensionType#TimeDimension}.
080     */
081    TimeMinutes,
082
083    /**
084     * Indicates that a level refers to seconds.
085     * It must be used in a dimension whose type is
086     * {@link DimensionType#TimeDimension}.
087     */
088    TimeSeconds,
089
090    /**
091     * Indicates that a level is an unspecified time period.
092     * It must be used in a dimension whose type is
093     * {@link DimensionType#TimeDimension}.
094     */
095    TimeUndefined,
096
097    /**
098     * Indicates that a level holds the null member.
099     */
100    Null;
101
102    /**
103     * Returns whether this is a time level.
104     *
105     * @return Whether this is a time level.
106     */
107    public boolean isTime() {
108        return ordinal() >= TimeYears.ordinal()
109           && ordinal() <= TimeUndefined.ordinal();
110    }
111}
112
113// End LevelType.java