Interface IIteratorEvaluator
-
- All Known Implementing Classes:
ContainerIterators.ClosureIteratorEvaluator,ContainerIterators.CollectingIteratorEvaluator,ContainerIterators.CollectIteratorEvaluator,ContainerIterators.NumberIteratorEvaluator
public interface IIteratorEvaluatorProvides an iterator aggregation function. Please note that aggregation functions do not have a state, i.e., no own memory.- Author:
- Holger Eichelberger
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Valueaggregate(EvaluationAccessor result, Value iter, EvaluationAccessor value, java.util.Map<java.lang.Object,java.lang.Object> data)Aggregatevaluetoresult.ValuegetStartResult(IDatatype type, IDatatype iterType)Returns the start result.voidpostProcessResult(EvaluationAccessor result, java.util.Map<java.lang.Object,java.lang.Object> data)Called to post-process the actual result at the end after the last iteration.
-
-
-
Method Detail
-
getStartResult
Value getStartResult(IDatatype type, IDatatype iterType) throws ValueDoesNotMatchTypeException
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, java.util.Map<java.lang.Object,java.lang.Object> data) throws ValueDoesNotMatchTypeException
Aggregatevaluetoresult.- 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, java.util.Map<java.lang.Object,java.lang.Object> data) throws ValueDoesNotMatchTypeException
Called 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
-
-