Package mondrian.spi
Interface UserDefinedFunction
-
- All Known Implementing Classes:
BasicQueryTest.CountConcurrentUdf
,BasicQueryTest.SleepUdf
,CurrentDateMemberExactUdf
,CurrentDateMemberUdf
,CurrentDateStringUdf
,InUdf
,InverseNormalUdf
,LastNonEmptyUdf
,MatchesUdf
,MockCurrentDateMember
,NullValueUdf
,PerformanceTest.CounterUdf
,UdfTest.AnotherMemberErrorUdf
,UdfTest.BadPlusOneUdf
,UdfTest.MdcUdf
,UdfTest.MemberNameFunction
,UdfTest.PlusOneUdf
,UdfTest.PlusOrMinusOneUdf
,UdfTest.ReverseFunction
,UdfTest.ReverseFunctionNotStatic
,UdfTest.ReverseIterableFunction
,UdfTest.StringMultUdf
,ValUdf
public interface UserDefinedFunction
Definition of a user-defined function.The class must have a public, zero-arguments constructor, be on Mondrian's runtime class-path, and be referenced from the schema file:
<Schema>
....
<UserDefinedFunction name="MyFun" class="com.acme.MyFun">
</Schema>- Author:
- jhyde
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
UserDefinedFunction.Argument
-
Method Summary
All Methods Instance Methods Abstract 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.
-
-
-
Method Detail
-
getName
java.lang.String getName()
Returns the name with which the user-defined function will be used from within MDX expressions.
-
getDescription
java.lang.String getDescription()
Returns a description of the user-defined function.
-
getSyntax
Syntax getSyntax()
Returns the syntactic type of the user-defined function. UsuallySyntax.Function
.
-
getParameterTypes
Type[] getParameterTypes()
Returns an array of the types of the parameters of this function.
-
getReturnType
Type getReturnType(Type[] parameterTypes)
Returns the return-type of this function.- Parameters:
parameterTypes
- Parameter types- Returns:
- Return type
-
execute
java.lang.Object execute(Evaluator evaluator, UserDefinedFunction.Argument[] arguments)
Applies this function to a set of arguments, and returns a result.- 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 asIIf
do not evaluate all arguments; this technique is called lazy evaluation.- Returns:
- The result value.
-
getReservedWords
java.lang.String[] getReservedWords()
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.
-
-