/
LevelType.java
115 lines (98 loc) · 2.86 KB
/
LevelType.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
/*
// $Id: //open/mondrian-release/3.1/src/main/mondrian/olap/LevelType.java#2 $
// This software is subject to the terms of the Eclipse Public License v1.0
// Agreement, available at the following URL:
// http://www.eclipse.org/legal/epl-v10.html.
// Copyright (C) 2004-2009 Julian Hyde
// All Rights Reserved.
// You must accept the terms of that agreement to use this software.
*/
package mondrian.olap;
/**
* Enumerates the types of levels.
*
* @deprecated Will be replaced with {@link org.olap4j.metadata.Level.Type}
* before mondrian-4.0.
*
* @author jhyde
* @since 5 April, 2004
* @version $Id: //open/mondrian-release/3.1/src/main/mondrian/olap/LevelType.java#2 $
*/
public enum LevelType {
/** Indicates that the level is not related to time. */
Regular,
/**
* Indicates that a level refers to years.
* It must be used in a dimension whose type is
* {@link DimensionType#TimeDimension}.
*/
TimeYears,
/**
* Indicates that a level refers to half years.
* It must be used in a dimension whose type is
* {@link DimensionType#TimeDimension}.
*/
TimeHalfYear,
/**
* Indicates that a level refers to quarters.
* It must be used in a dimension whose type is
* {@link DimensionType#TimeDimension}.
*/
TimeQuarters,
/**
* Indicates that a level refers to months.
* It must be used in a dimension whose type is
* {@link DimensionType#TimeDimension}.
*/
TimeMonths,
/**
* Indicates that a level refers to weeks.
* It must be used in a dimension whose type is
* {@link DimensionType#TimeDimension}.
*/
TimeWeeks,
/**
* Indicates that a level refers to days.
* It must be used in a dimension whose type is
* {@link DimensionType#TimeDimension}.
*/
TimeDays,
/**
* Indicates that a level refers to hours.
* It must be used in a dimension whose type is
* {@link DimensionType#TimeDimension}.
*/
TimeHours,
/**
* Indicates that a level refers to minutes.
* It must be used in a dimension whose type is
* {@link DimensionType#TimeDimension}.
*/
TimeMinutes,
/**
* Indicates that a level refers to seconds.
* It must be used in a dimension whose type is
* {@link DimensionType#TimeDimension}.
*/
TimeSeconds,
/**
* Indicates that a level is an unspecified time period.
* It must be used in a dimension whose type is
* {@link DimensionType#TimeDimension}.
*/
TimeUndefined,
/**
* Indicates that a level holds the null member.
*/
Null;
/**
* Returns whether this is a time level.
*
* @return Whether this is a time level.
*/
public boolean isTime() {
return ordinal() >= TimeYears.ordinal()
&& ordinal() <= TimeUndefined.ordinal();
}
}
// End LevelType.java