Class BaseFirstOrderFunctionCall.EagerPartlyBagEval<RETURN_T extends Value,PRIMITIVE_PARAM_T extends AttributeValue>
- java.lang.Object
-
- org.ow2.authzforce.core.pdp.api.func.BaseFirstOrderFunctionCall<RETURN_T>
-
- org.ow2.authzforce.core.pdp.api.func.BaseFirstOrderFunctionCall.EagerEval<RETURN_T>
-
- org.ow2.authzforce.core.pdp.api.func.BaseFirstOrderFunctionCall.EagerPartlyBagEval<RETURN_T,PRIMITIVE_PARAM_T>
-
- Type Parameters:
RETURN_T
- function return typePRIMITIVE_PARAM_T
- primitive values' supertype, i.e. bag element type for bag parameter and the parameter datatype for primitive parameters. If argument expressions return different datatypes, the supertype of all -AttributeValue
- may be specified.
- All Implemented Interfaces:
FirstOrderFunctionCall<RETURN_T>
,FunctionCall<RETURN_T>
- Enclosing class:
- BaseFirstOrderFunctionCall<RETURN extends Value>
public abstract static class BaseFirstOrderFunctionCall.EagerPartlyBagEval<RETURN_T extends Value,PRIMITIVE_PARAM_T extends AttributeValue> extends BaseFirstOrderFunctionCall.EagerEval<RETURN_T>
Function call, for functions requiring eager (a.k.a. greedy) evaluation of ALL their arguments' expressions to actual values, before the function can be evaluated. To be used only if there is a mix of primitive and bag arguments.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.ow2.authzforce.core.pdp.api.func.BaseFirstOrderFunctionCall
BaseFirstOrderFunctionCall.EagerBagEval<RETURN_T extends Value,PARAM_BAG_ELEMENT_T extends AttributeValue>, BaseFirstOrderFunctionCall.EagerEval<RETURN_T extends Value>, BaseFirstOrderFunctionCall.EagerMultiPrimitiveTypeEval<RETURN_T extends Value>, BaseFirstOrderFunctionCall.EagerPartlyBagEval<RETURN_T extends Value,PRIMITIVE_PARAM_T extends AttributeValue>, BaseFirstOrderFunctionCall.EagerSinglePrimitiveTypeEval<RETURN_T extends Value,PARAM_T extends AttributeValue>
-
-
Field Summary
-
Fields inherited from class org.ow2.authzforce.core.pdp.api.func.BaseFirstOrderFunctionCall.EagerEval
argExpressions, functionId, indeterminateArgMessage, numOfSameTypePrimitiveParamsBeforeBag, totalArgCount
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
EagerPartlyBagEval(FirstOrderFunctionSignature<RETURN_T> functionSig, BagDatatype<PRIMITIVE_PARAM_T> bagParamType, Class<PRIMITIVE_PARAM_T[]> primitiveArrayClass, List<Expression<?>> args, Datatype<?>[] remainingArgTypes)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract RETURN_T
evaluate(Deque<PRIMITIVE_PARAM_T> primArgsBeforeBag, Bag<PRIMITIVE_PARAM_T>[] bagArgs, PRIMITIVE_PARAM_T[] remainingArgs)
Make the call with attribute values as arguments.RETURN_T
evaluate(EvaluationContext context, AttributeValue... remainingArgs)
Make the call in a given evaluation context and argument values resolved at evaluation time.-
Methods inherited from class org.ow2.authzforce.core.pdp.api.func.BaseFirstOrderFunctionCall
evaluate, evaluate, getReturnType
-
-
-
-
Constructor Detail
-
EagerPartlyBagEval
protected EagerPartlyBagEval(FirstOrderFunctionSignature<RETURN_T> functionSig, BagDatatype<PRIMITIVE_PARAM_T> bagParamType, Class<PRIMITIVE_PARAM_T[]> primitiveArrayClass, List<Expression<?>> args, Datatype<?>[] remainingArgTypes) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
-
Method Detail
-
evaluate
protected abstract RETURN_T evaluate(Deque<PRIMITIVE_PARAM_T> primArgsBeforeBag, Bag<PRIMITIVE_PARAM_T>[] bagArgs, PRIMITIVE_PARAM_T[] remainingArgs) throws IndeterminateEvaluationException
Make the call with attribute values as arguments. (The pre-evaluation of argument expressions in the evaluation context is already handled internally by this class.)- Returns:
- result of the call
- Throws:
IndeterminateEvaluationException
- if any error evaluating the function
-
evaluate
public final RETURN_T evaluate(EvaluationContext context, AttributeValue... remainingArgs) throws IndeterminateEvaluationException
Description copied from interface:FirstOrderFunctionCall
Make the call in a given evaluation context and argument values resolved at evaluation time. This method is called byFirstOrderFunctionCall.evaluate(EvaluationContext, boolean, AttributeValue...)
after checking evaluation-time args.- Parameters:
context
- evaluation contextremainingArgs
- remaining args (not yet known at initialization time). Null if none. Only non-bag/primitive values are validremainingArgs
to prevent varargs warning (potential heap pollution via varargs parameter) that would be caused by using a parameterized type such as Value/Collection to represent both bags and primitives.- Returns:
- result of the call
- Throws:
IndeterminateEvaluationException
- if any error evaluating the function
-
-