Class ContainerIterators.NumberIteratorEvaluator

java.lang.Object
net.ssehub.easy.varModel.cstEvaluation.ContainerIterators.NumberIteratorEvaluator
All Implemented Interfaces:
IIteratorEvaluator
Enclosing class:
ContainerIterators

private abstract static class ContainerIterators.NumberIteratorEvaluator extends Object implements IIteratorEvaluator
A number aggregating iterator.
Author:
Holger Eichelberger
  • Constructor Details

    • NumberIteratorEvaluator

      private NumberIteratorEvaluator()
  • Method Details

    • intOp

      protected abstract int intOp(int i1, int i2)
      Performs the integer aggregation operation.
      Parameters:
      i1 - the first integer
      i2 - the second integer
      Returns:
      the aggregated value
    • doubleOp

      protected abstract double doubleOp(double d1, double d2)
      Performs the double aggregation operation.
      Parameters:
      d1 - the first double
      d2 - the second double
      Returns:
      the aggregated value
    • aggregate

      Description copied from interface: IIteratorEvaluator
      Aggregate value to result.
      Specified by:
      aggregate in interface IIteratorEvaluator
      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
    • getStartResult

      public Value getStartResult(IDatatype type, IDatatype iterType) throws ValueDoesNotMatchTypeException
      Description copied from interface: IIteratorEvaluator
      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.
      Specified by:
      getStartResult in interface IIteratorEvaluator
      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
    • postProcessResult

      public void postProcessResult(EvaluationAccessor result, Map<Object,Object> data) throws ValueDoesNotMatchTypeException
      Description copied from interface: IIteratorEvaluator
      Called to post-process the actual result at the end after the last iteration.
      Specified by:
      postProcessResult in interface IIteratorEvaluator
      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