Interface IIteratorEvaluator
- All Known Implementing Classes:
ContainerIterators.ClosureIteratorEvaluator,ContainerIterators.CollectingIteratorEvaluator,ContainerIterators.CollectIteratorEvaluator,ContainerIterators.NumberIteratorEvaluator
public interface IIteratorEvaluator
Provides an iterator aggregation function. Please note that aggregation functions do not have
a state, i.e., no own memory.
- Author:
- Holger Eichelberger
-
Method Summary
Modifier and TypeMethodDescriptionaggregate(EvaluationAccessor result, Value iter, EvaluationAccessor value, Map<Object, Object> data) Aggregatevaluetoresult.getStartResult(IDatatype type, IDatatype iterType) Returns the start result.voidpostProcessResult(EvaluationAccessor result, Map<Object, Object> data) Called to post-process the actual result at the end after the last iteration.
-
Method Details
-
getStartResult
Returns the start result. Used in case of all operations where the start result is implicitly clear from the operation itself and not explicitly defined in the model.- Parameters:
type- the type of the return valueiterType- the type of the iterator expression- Returns:
- the start value (must comply to
type) - Throws:
ValueDoesNotMatchTypeException- in case of type compatibility problems
-
aggregate
Value aggregate(EvaluationAccessor result, Value iter, EvaluationAccessor value, Map<Object, Object> data) throws ValueDoesNotMatchTypeExceptionAggregatevaluetoresult.- Parameters:
result- the aggregating resultiter- the current value of the iteratorvalue- the value to be aggregateddata- arbitrary data to be hold while actually evaluating the function- Returns:
- a boolean value to indicate whether iteration/evaluation shall stop (
trueif iteration shall stop due to this evaluation,falseelse), a collection of values as instance ofListWrapperValuewhere to go on - Throws:
ValueDoesNotMatchTypeException- in case of type compatibility problems
-
postProcessResult
void postProcessResult(EvaluationAccessor result, Map<Object, Object> data) throws ValueDoesNotMatchTypeExceptionCalled to post-process the actual result at the end after the last iteration.- Parameters:
result- the aggregated result so fardata- arbitrary data to be hold while actually evaluating the function- Throws:
ValueDoesNotMatchTypeException- in case of type compatibility problems
-