1 /* 2 // $Id: //open/mondrian/src/main/mondrian/olap/LevelType.java#10 $ 3 // This software is subject to the terms of the Common Public License 4 // Agreement, available at the following URL: 5 // http://www.opensource.org/licenses/cpl.html. 6 // Copyright (C) 2004-2006 Julian Hyde 7 // All Rights Reserved. 8 // You must accept the terms of that agreement to use this software. 9 */ 10 package mondrian.olap; 11 12 13 14 /** 15 * Enumerates the types of levels. 16 * 17 * @author jhyde 18 * @since 5 April, 2004 19 * @version $Id: //open/mondrian/src/main/mondrian/olap/LevelType.java#10 $ 20 */ 21 public enum LevelType { 22 23 /** Indicates that the level is not related to time. */ 24 Regular, 25 26 /** 27 * Indicates that a level refers to years. 28 * It must be used in a dimension whose type is 29 * {@link DimensionType#TimeDimension}. 30 */ 31 TimeYears, 32 33 /** 34 * Indicates that a level refers to quarters. 35 * It must be used in a dimension whose type is 36 * {@link DimensionType#TimeDimension}. 37 */ 38 TimeQuarters, 39 40 /** 41 * Indicates that a level refers to months. 42 * It must be used in a dimension whose type is 43 * {@link DimensionType#TimeDimension}. 44 */ 45 TimeMonths, 46 47 /** 48 * Indicates that a level refers to weeks. 49 * It must be used in a dimension whose type is 50 * {@link DimensionType#TimeDimension}. 51 */ 52 TimeWeeks, 53 54 /** 55 * Indicates that a level refers to days. 56 * It must be used in a dimension whose type is 57 * {@link DimensionType#TimeDimension}. 58 */ 59 TimeDays, 60 61 /** 62 * Indicates that a level holds the null member. 63 */ 64 Null; 65 66 public boolean isTime() { 67 return ordinal() >= TimeYears.ordinal() && 68 ordinal() <= TimeDays.ordinal(); 69 } 70 } 71 72 // End LevelType.java 73