org.eclipse.ocl.examples.domain.library
Class EvaluatorIterationManager

java.lang.Object
  extended by org.eclipse.ocl.examples.domain.library.AbstractIterationManager
      extended by org.eclipse.ocl.examples.domain.library.EvaluatorIterationManager
All Implemented Interfaces:
DomainIterationManager
Direct Known Subclasses:
EvaluatorMultipleIterationManager, EvaluatorSingleIterationManager

public abstract class EvaluatorIterationManager
extends AbstractIterationManager


Nested Class Summary
protected static class EvaluatorIterationManager.ValueIterator
           
 
Field Summary
protected  DomainTypedElement accumulatorVariable
           
protected  DomainExpression body
           
protected  CollectionValue collectionValue
           
 
Fields inherited from class org.eclipse.ocl.examples.domain.library.AbstractIterationManager
evaluator
 
Constructor Summary
EvaluatorIterationManager(DomainEvaluator evaluator, DomainExpression body, CollectionValue collectionValue, DomainTypedElement accumulatorVariable, java.lang.Object accumulatorValue)
           
EvaluatorIterationManager(EvaluatorIterationManager iterationManager, CollectionValue collectionValue)
           
 
Method Summary
protected static EvaluatorIterationManager.ValueIterator[] createIterators(DomainTypedElement[] referredIterators, DomainEvaluator evaluator, CollectionValue collectionValue)
           
 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 getCollectionValue()
           
 DomainEvaluationEnvironment getEvaluationEnvironment()
           
 CollectionValue getSourceCollection()
          Return the source collection over which this (nested) iteration iterates.
 java.lang.String toString()
           
 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, wait, wait, wait
 
Methods inherited from interface org.eclipse.ocl.examples.domain.evaluation.DomainIterationManager
advanceIterators, hasCurrent
 

Field Detail

collectionValue

@NonNull
protected final CollectionValue collectionValue

body

@NonNull
protected final DomainExpression body

accumulatorVariable

@Nullable
protected final DomainTypedElement accumulatorVariable
Constructor Detail

EvaluatorIterationManager

public EvaluatorIterationManager(@NonNull
                                 DomainEvaluator evaluator,
                                 @NonNull
                                 DomainExpression body,
                                 @NonNull
                                 CollectionValue collectionValue,
                                 @Nullable
                                 DomainTypedElement accumulatorVariable,
                                 @Nullable
                                 java.lang.Object accumulatorValue)

EvaluatorIterationManager

public EvaluatorIterationManager(@NonNull
                                 EvaluatorIterationManager iterationManager,
                                 @NonNull
                                 CollectionValue collectionValue)
Method Detail

createIterators

protected static EvaluatorIterationManager.ValueIterator[] createIterators(@NonNull
                                                                           DomainTypedElement[] referredIterators,
                                                                           @NonNull
                                                                           DomainEvaluator evaluator,
                                                                           @NonNull
                                                                           CollectionValue collectionValue)

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.


getCollectionValue

@NonNull
public CollectionValue getCollectionValue()

getEvaluationEnvironment

@NonNull
public DomainEvaluationEnvironment getEvaluationEnvironment()

getSourceCollection

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


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

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.