001    /*
002    // $Id: //open/mondrian/src/main/mondrian/udf/CurrentDateMemberExactUdf.java#5 $
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) 2006-2007 Julian Hyde and others
007    // All Rights Reserved.
008    // You must accept the terms of that agreement to use this software.
009    */
010    package mondrian.udf;
011    
012    import mondrian.olap.type.*;
013    import mondrian.util.*;
014    
015    /**
016     * User-defined function <code>CurrentDateMember</code>.  Arguments to the
017     * function are as follows:
018     *
019     * <blockquote>
020     * <code>
021     * CurrentDateMember(&lt;Hierarchy&gt;, &lt;FormatString&gt;)
022     * returns &lt;Member&gt;
023     * </code>
024     * </blockquote>
025     *
026     * The function returns the member from the specified hierarchy that matches
027     * the current date, to the granularity specified by the &lt;FormatString&gt;.
028     *
029     * The format string conforms to the format string implemented by
030     * {@link Format}.
031     *
032     * @author Zelaine Fong
033     * @version $Id: //open/mondrian/src/main/mondrian/udf/CurrentDateMemberExactUdf.java#5 $
034     */
035    public class CurrentDateMemberExactUdf extends CurrentDateMemberUdf {
036    
037        public String getDescription() {
038            return "Returns the exact member within the specified dimension corresponding to the current date, in the format specified by the format parameter. "
039                + "If there is no such date, returns the NULL member. "
040                + "Format strings are the same as used by the MDX Format function, namely the Visual Basic format strings. See http://www.apostate.com/programming/vb-format.html.";
041        }
042    
043        public Type[] getParameterTypes() {
044            return new Type[] {
045                new HierarchyType(null, null),
046                new StringType()
047            };
048        }
049    
050        public String[] getReservedWords() {
051            return null;
052        }
053    }
054    
055    // End CurrentDateMemberExactUdf.java