/libformula-1.1.3/source/org/pentaho/reporting/libraries/formula/function/information/CountBlankFunctionDescription.java

# · Java · 76 lines · 33 code · 8 blank · 35 comment · 0 complexity · 30f45990be1a71436122d07305530490 MD5 · raw file

  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. package org.pentaho.reporting.libraries.formula.function.information;
  18. import org.pentaho.reporting.libraries.formula.function.AbstractFunctionDescription;
  19. import org.pentaho.reporting.libraries.formula.function.FunctionCategory;
  20. import org.pentaho.reporting.libraries.formula.typing.Type;
  21. import org.pentaho.reporting.libraries.formula.typing.coretypes.NumberType;
  22. import org.pentaho.reporting.libraries.formula.typing.coretypes.AnyType;
  23. /**
  24. * Describes the CountBlankFunction function.
  25. *
  26. * @author Cedric Pronzato
  27. * @see org.pentaho.reporting.libraries.formula.function.information.CountBlankFunction
  28. */
  29. public class CountBlankFunctionDescription extends AbstractFunctionDescription
  30. {
  31. public CountBlankFunctionDescription()
  32. {
  33. super("COUNTBLANK", "org.pentaho.reporting.libraries.formula.function.information.CountBlank-Function");
  34. }
  35. public Type getValueType()
  36. {
  37. return NumberType.GENERIC_NUMBER;
  38. }
  39. public FunctionCategory getCategory()
  40. {
  41. return InformationFunctionCategory.CATEGORY;
  42. }
  43. public int getParameterCount()
  44. {
  45. return 1;
  46. }
  47. /**
  48. * Returns the parameter type at the given position using the function metadata. The first parameter is at the
  49. * position 0;
  50. *
  51. * @param position The parameter index.
  52. * @return The parameter type.
  53. */
  54. public Type getParameterType(final int position)
  55. {
  56. return AnyType.ANY_SEQUENCE;
  57. }
  58. /**
  59. * Defines, whether the parameter at the given position is mandatory. A mandatory parameter must be filled in, while
  60. * optional parameters need not to be filled in.
  61. *
  62. * @return
  63. */
  64. public boolean isParameterMandatory(final int position)
  65. {
  66. return true;
  67. }
  68. }