/libformula-1.1.3/source/org/pentaho/reporting/libraries/formula/function/datetime/TimeValueFunctionDescription.java
Java | 71 lines | 34 code | 9 blank | 28 comment | 0 complexity | aa7c9742b4dc6a4532b4b649733463ab MD5 | raw file
Possible License(s): LGPL-2.1
1/*
2 * This program is free software; you can redistribute it and/or modify it under the
3 * terms of the GNU Lesser General Public License, version 2.1 as published by the Free Software
4 * Foundation.
5 *
6 * You should have received a copy of the GNU Lesser General Public License along with this
7 * program; if not, you can obtain a copy at http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
8 * or from the Free Software Foundation, Inc.,
9 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
10 *
11 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
12 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * See the GNU Lesser General Public License for more details.
14 *
15 * Copyright (c) 2006 - 2009 Pentaho Corporation and Contributors. All rights reserved.
16 */
17
18package org.pentaho.reporting.libraries.formula.function.datetime;
19
20import org.pentaho.reporting.libraries.formula.function.AbstractFunctionDescription;
21import org.pentaho.reporting.libraries.formula.function.FunctionCategory;
22import org.pentaho.reporting.libraries.formula.typing.Type;
23import org.pentaho.reporting.libraries.formula.typing.coretypes.DateTimeType;
24import org.pentaho.reporting.libraries.formula.typing.coretypes.TextType;
25
26/**
27 * Describes the TimeFunction function
28 *
29 * @author Cedric Pronzato
30 * @see TimeFunction
31 */
32public class TimeValueFunctionDescription extends AbstractFunctionDescription
33{
34 private static final long serialVersionUID = 5414013076902907910L;
35
36 public TimeValueFunctionDescription()
37 {
38 super("TIMEVALUE", "org.pentaho.reporting.libraries.formula.function.datetime.TimeValue-Function");
39 }
40
41 public Type getValueType()
42 {
43 return DateTimeType.TIME_TYPE;
44 }
45
46 public int getParameterCount()
47 {
48 return 1;
49 }
50
51 public Type getParameterType(final int position)
52 {
53 return TextType.TYPE;
54 }
55
56 /**
57 * Defines, whether the parameter at the given position is mandatory. A mandatory parameter must be filled in, while
58 * optional parameters need not to be filled in.
59 *
60 * @return
61 */
62 public boolean isParameterMandatory(final int position)
63 {
64 return true;
65 }
66
67 public FunctionCategory getCategory()
68 {
69 return DateTimeFunctionCategory.CATEGORY;
70 }
71}