Package mondrian.test

Class UdfTest.PlusOrMinusOneUdf

  • All Implemented Interfaces:
    UserDefinedFunction
    Enclosing class:
    UdfTest

    public static class UdfTest.PlusOrMinusOneUdf
    extends java.lang.Object
    implements UserDefinedFunction
    A user-defined function which, depending on its given name, either adds one to, or subtracts one from, its argument.
    • Constructor Summary

      Constructors 
      Constructor Description
      PlusOrMinusOneUdf​(java.lang.String name)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object execute​(Evaluator evaluator, UserDefinedFunction.Argument[] arguments)
      Applies this function to a set of arguments, and returns a result.
      java.lang.String getDescription()
      Returns a description of the user-defined function.
      java.lang.String getName()
      Returns the name with which the user-defined function will be used from within MDX expressions.
      Type[] getParameterTypes()
      Returns an array of the types of the parameters of this function.
      java.lang.String[] getReservedWords()
      Returns a list of reserved words used by this function.
      Type getReturnType​(Type[] parameterTypes)
      Returns the return-type of this function.
      Syntax getSyntax()
      Returns the syntactic type of the user-defined function.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PlusOrMinusOneUdf

        public PlusOrMinusOneUdf​(java.lang.String name)
    • Method Detail

      • getName

        public java.lang.String getName()
        Description copied from interface: UserDefinedFunction
        Returns the name with which the user-defined function will be used from within MDX expressions.
        Specified by:
        getName in interface UserDefinedFunction
      • getReturnType

        public Type getReturnType​(Type[] parameterTypes)
        Description copied from interface: UserDefinedFunction
        Returns the return-type of this function.
        Specified by:
        getReturnType in interface UserDefinedFunction
        Parameters:
        parameterTypes - Parameter types
        Returns:
        Return type
      • getReservedWords

        public java.lang.String[] getReservedWords()
        Description copied from interface: UserDefinedFunction
        Returns a list of reserved words used by this function. May return an empty array or null if this function does not require any reserved words.
        Specified by:
        getReservedWords in interface UserDefinedFunction
      • execute

        public java.lang.Object execute​(Evaluator evaluator,
                                        UserDefinedFunction.Argument[] arguments)
        Description copied from interface: UserDefinedFunction
        Applies this function to a set of arguments, and returns a result.
        Specified by:
        execute in interface UserDefinedFunction
        Parameters:
        evaluator - Evaluator containts the runtime context, in particular the current member of each dimension.
        arguments - Expressions which yield the arguments of this function. Most user-defined functions will evaluate all arguments before using them. Functions such as IIf do not evaluate all arguments; this technique is called lazy evaluation.
        Returns:
        The result value.