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 Details

    • 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 value
      iterType - the type of the iterator expression
      Returns:
      the start value (must comply to type)
      Throws:
      ValueDoesNotMatchTypeException - in case of type compatibility problems
    • aggregate

      Aggregate value to result.
      Parameters:
      result - the aggregating result
      iter - the current value of the iterator
      value - the value to be aggregated
      data - arbitrary data to be hold while actually evaluating the function
      Returns:
      a boolean value to indicate whether iteration/evaluation shall stop (true if iteration shall stop due to this evaluation, false else), a collection of values as instance of ListWrapperValue where to go on
      Throws:
      ValueDoesNotMatchTypeException - in case of type compatibility problems
    • postProcessResult

      void postProcessResult(EvaluationAccessor result, Map<Object,Object> data) throws ValueDoesNotMatchTypeException
      Called to post-process the actual result at the end after the last iteration.
      Parameters:
      result - the aggregated result so far
      data - arbitrary data to be hold while actually evaluating the function
      Throws:
      ValueDoesNotMatchTypeException - in case of type compatibility problems