Class EvaluationVisitor.ContainerIterationExecutor

  • Enclosing class:
    EvaluationVisitor

    private class EvaluationVisitor.ContainerIterationExecutor
    extends java.lang.Object
    Implements flattening/non-flattening container evaluation.
    Author:
    Holger Eichelberger
    • Constructor Detail

      • ContainerIterationExecutor

        private ContainerIterationExecutor​(ContainerOperationCall call,
                                           LocalDecisionVariable[] declarators,
                                           VariableAccessor resultVar,
                                           IIteratorEvaluator evaluator)
        Creates a container iteration executor with own context.
        Parameters:
        call - the call to evaluate
        declarators - the declarators
        resultVar - the result variable / declarator
        evaluator - the evaluator for call
    • Method Detail

      • determineContainer

        private void determineContainer()
        Determines the container value to iterate over from the container expression. If needed, create an implicit temporary container (if operation is applied to a non-container variable).
      • initialize

        private boolean initialize​(ContainerValue[] containers,
                                   LocalDecisionVariable[] declarators)
        Initialize the container iterators for a container iteration.
        Parameters:
        containers - the containers to be assigned to the declarators
        declarators - the declarators
        Returns:
        true if initialization was successful, false else
      • execute

        private boolean execute​(int iterCount)
        Evaluate for the given number of iterators.
        Parameters:
        iterCount - the number of iterators
        Returns:
        true for success, false else
      • evaluateIterator

        private boolean evaluateIterator​(int iter,
                                         Value iterVal,
                                         IDecisionVariable iterVar,
                                         int maxIter,
                                         boolean setSelf,
                                         EvaluationAccessor rVar)
        Evaluates an iterator. Considers the nesting mode and flattens/builds up sub-collections if needed.
        Parameters:
        iter - the declarator iteration index
        iterVal - the actual value of the iterator
        iterVar - the alternative iterator variable (may be null)
        maxIter - the maximum iteration index
        setSelf - whether EvaluationVisitor.selfValue shall be modified
        rVar - the result value accessor
        Returns:
        whether the execution was ok (true) or not false)