Package mondrian.spi
Interface UserDefinedFunction.Argument
- Enclosing interface:
- UserDefinedFunction
public static interface UserDefinedFunction.Argument
-
Method Summary
Modifier and TypeMethodDescriptionEvaluates the argument.evaluateIterable
(Evaluator eval) Evaluates the argument to an iterable over members or tuples.evaluateList
(Evaluator eval) Evaluates the argument to a list of members or tuples.evaluateScalar
(Evaluator evaluator) Evaluates the argument as a scalar expression.getType()
Returns the type of the argument.
-
Method Details
-
getType
Type getType()Returns the type of the argument.- Returns:
- Argument type
-
evaluateScalar
Evaluates the argument as a scalar expression.The effect is the same as
evaluate(mondrian.olap.Evaluator)
except if the argument evaluates to a member or tuple. This method will set the context to the member or tuple and evaluate the current measure, whereasevaluate
would return the member or tuple.The effect is similar to creating a calculated member in an MDX query:
WITH MEMBER [Measures].[Previous Period] AS
([Measures].[Unit Sales], [Time].[Time].PrevMember)
SELECT {[Measures].[Unit Sales],
[Measures].[Previous Period]} on 0,
[Time].[Time].Children on 1
FROM [Sales]Note how
[Measures].[Previous Period]
is defined as a tuple, but evaluates to a number.- Parameters:
evaluator
- Evaluation context- Returns:
- Scalar expression at the given member or tuple
-
evaluate
Evaluates the argument.If the argument is a set of members or tuples, this method may return either a
List
or anIterable
. It is not safe to blindly cast toList
. For guaranteed type, callevaluateList(mondrian.olap.Evaluator)
orevaluateIterable(mondrian.olap.Evaluator)
.- Parameters:
evaluator
- Evaluation context- Returns:
- Result of evaluating the argument
-
evaluateList
Evaluates the argument to a list of members or tuples.- Parameters:
eval
- Evaluation context- Returns:
- List of members or tuples.
-
evaluateIterable
Evaluates the argument to an iterable over members or tuples.- Parameters:
eval
- Evaluation context- Returns:
- Iterable over members or tuples.
-