KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > mondrian > udf > CurrentDateMemberExactUdf


1 /*
2 // $Id: //open/mondrian/src/main/mondrian/udf/CurrentDateMemberExactUdf.java#2 $
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) 2006-2006 Julian Hyde and others
7 // All Rights Reserved.
8 // You must accept the terms of that agreement to use this software.
9 */

10 package mondrian.udf;
11
12 import mondrian.olap.type.*;
13 import mondrian.util.*;
14
15 /**
16  * User-defined function <code>CurrentDateMember</code>. Arguments to the
17  * function are as follows:
18  *
19  * <blockquote>
20  * <code>
21  * CurrentDataMember(&lt;Hierarchy&gt;, &lt;FormatString&gt;) returns &lt;Member&gt;
22  * </code>
23  * </blockquote>
24  *
25  * The function returns the member from the specified hierarchy that matches
26  * the current date, to the granularity specified by the &lt;FormatString&gt;.
27  *
28  * The format string conforms to the format string implemented by
29  * {@link Format}.
30  *
31  * @author Zelaine Fong
32  * @version $Id: //open/mondrian/src/main/mondrian/udf/CurrentDateMemberExactUdf.java#2 $
33  */

34 public class CurrentDateMemberExactUdf extends CurrentDateMemberUdf {
35
36     public String JavaDoc getDescription() {
37         return "Returns the member within the specified dimension corresponding to the current date, in the format specified by the format parameter.";
38     }
39
40     public Type[] getParameterTypes() {
41         return new Type[] {
42             new HierarchyType(null, null),
43             new StringType()
44         };
45     }
46
47     public String JavaDoc[] getReservedWords() {
48         return null;
49     }
50 }
51
52 // End CurrentDateMemberExactUdf.java
53
Popular Tags