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  TypeId returnTypeId
           
 
Fields inherited from class org.eclipse.ocl.examples.domain.library.AbstractIterationManager
evaluator
 
Constructor Summary
ExecutorDoubleIterationManager(DomainEvaluator evaluator, TypeId returnTypeId, LibraryTernaryOperation body, CollectionValue collectionValue, java.lang.Object accumulatorValue)
           
 
Method Summary
 boolean advanceIterators()
          Advance the iterators to the next iteration, returning false once all possible iterator states have been exhausted.
 java.lang.Object evaluateBody()
          Evaluate the iteration body for the current iterators and return the evaluation result.
 java.lang.Object getAccumulatorValue()
          Get the current state of the accumulator.
 CollectionValue getSourceCollection()
          Return the source collection over which this (nested) iteration iterates.
 boolean hasCurrent()
          Return true if the iterators have a step to be evaluated.
 java.lang.Object updateAccumulator(java.lang.Object newValue)
          Update the accumulator witrh the result of a body iteration.
 
Methods inherited from class org.eclipse.ocl.examples.domain.library.AbstractIterationManager
createNestedIterationManager, dispose, get, getEvaluator, getStandardLibrary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

returnTypeId

@NonNull
protected final TypeId returnTypeId

body

@NonNull
protected final LibraryTernaryOperation body

collectionValue

@NonNull
protected final CollectionValue collectionValue
Constructor Detail

ExecutorDoubleIterationManager

public ExecutorDoubleIterationManager(@NonNull
                                      DomainEvaluator evaluator,
                                      @NonNull
                                      TypeId returnTypeId,
                                      @NonNull
                                      LibraryTernaryOperation body,
                                      @Nullable
                                      CollectionValue collectionValue,
                                      @Nullable
                                      java.lang.Object 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

@Nullable
public java.lang.Object 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

@Nullable
public java.lang.Object getAccumulatorValue()
Description copied from interface: DomainIterationManager
Get the current state of the accumulator.


getSourceCollection

@NonNull
public CollectionValue getSourceCollection()
Description copied from interface: DomainIterationManager
Return the source collection over which this (nested) iteration iterates.


hasCurrent

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


updateAccumulator

@Nullable
public java.lang.Object updateAccumulator(java.lang.Object newValue)
Description copied from interface: DomainIterationManager
Update the accumulator witrh the result of a body iteration.
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.