org.eclipse.ocl.examples.library.executor
Class ExecutorDoubleIterationManager

java.lang.Object
  extended by org.eclipse.ocl.examples.domain.library.AbstractIterationManager
      extended by org.eclipse.ocl.examples.library.executor.ExecutorDoubleIterationManager
All Implemented Interfaces:
DomainIterationManager

public class ExecutorDoubleIterationManager
extends AbstractIterationManager


Field Summary
protected  LibraryTernaryOperation body
           
protected  CollectionValue collectionValue
           
protected  DomainType returnType
           
 
Fields inherited from class org.eclipse.ocl.examples.domain.library.AbstractIterationManager
evaluator
 
Constructor Summary
ExecutorDoubleIterationManager(DomainEvaluator evaluator, DomainType returnType, LibraryTernaryOperation body, CollectionValue collectionValue, Value accumulatorValue)
           
 
Method Summary
 boolean advanceIterators()
          Advance the iterators to the next iteration, returning false once all possible iterator states have been exhausted.
 Value evaluateBody()
          Evaluate the iteration body for the current iterators and return the evaluation result.
 Value getAccumulatorValue()
          Get the current state of the accumulator.
 boolean hasCurrent()
          Return true if the iterators have a step to be evaluated.
 NullValue throwInvalidEvaluation(java.lang.String message, java.lang.Object... bindings)
           
 Value updateBody()
          Evaluate the iteration body for the current iterators and update the accumulator accordingly.
 
Methods inherited from class org.eclipse.ocl.examples.domain.library.AbstractIterationManager
createNestedIterationManager, get, getValueFactory, isOuterIteration, throwInvalidEvaluation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

returnType

protected final DomainType returnType

body

protected final LibraryTernaryOperation body

collectionValue

protected final CollectionValue collectionValue
Constructor Detail

ExecutorDoubleIterationManager

public ExecutorDoubleIterationManager(DomainEvaluator evaluator,
                                      DomainType returnType,
                                      LibraryTernaryOperation body,
                                      CollectionValue collectionValue,
                                      Value accumulatorValue)
Method Detail

advanceIterators

public boolean advanceIterators()
Description copied from interface: DomainIterationManager
Advance the iterators to the next iteration, returning false once all possible iterator states have been exhausted.


evaluateBody

public Value evaluateBody()
Description copied from interface: DomainIterationManager
Evaluate the iteration body for the current iterators and return the evaluation result.
This is used by non-iterate iteration that intervene between the body evaluation and accumulator update.


getAccumulatorValue

public Value getAccumulatorValue()
Description copied from interface: DomainIterationManager
Get the current state of the accumulator.


hasCurrent

public boolean hasCurrent()
Description copied from interface: DomainIterationManager
Return true if the iterators have a step to be evaluated.


throwInvalidEvaluation

public NullValue throwInvalidEvaluation(java.lang.String message,
                                        java.lang.Object... bindings)
                                 throws InvalidEvaluationException
Throws:
InvalidEvaluationException

updateBody

public Value updateBody()
                 throws InvalidValueException
Description copied from interface: DomainIterationManager
Evaluate the iteration body for the current iterators and update the accumulator accordingly.
This implements the body of an iterate iteration for which the accumulator value may be assigned to a completely independent value. Returns null for the iteration to continue, non-null to terminate.

Throws:
InvalidValueException