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, Value accumulatorValue)
           
EvaluatorIterationManager(EvaluatorIterationManager iterationManager, CollectionValue collectionValue)
           
 
Method Summary
protected static EvaluatorIterationManager.ValueIterator[] createIterators(DomainTypedElement[] referredIterators, DomainEvaluator evaluator, CollectionValue collectionValue)
           
 Value evaluateBody()
          Evaluate the iteration body for the current iterators and return the evaluation result.
 Value getAccumulatorValue()
          Get the current state of the accumulator.
 CollectionValue getCollectionValue()
           
 DomainEvaluationEnvironment getEvaluationEnvironment()
           
 NullValue throwInvalidEvaluation(java.lang.String message, java.lang.Object... bindings)
           
 java.lang.String toString()
           
 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, wait, wait, wait
 
Methods inherited from interface org.eclipse.ocl.examples.domain.evaluation.DomainIterationManager
advanceIterators, hasCurrent
 

Field Detail

collectionValue

protected final CollectionValue collectionValue

body

protected final DomainExpression body

accumulatorVariable

protected final DomainTypedElement accumulatorVariable
Constructor Detail

EvaluatorIterationManager

public EvaluatorIterationManager(DomainEvaluator evaluator,
                                 DomainExpression body,
                                 CollectionValue collectionValue,
                                 DomainTypedElement accumulatorVariable,
                                 Value accumulatorValue)

EvaluatorIterationManager

public EvaluatorIterationManager(EvaluatorIterationManager iterationManager,
                                 CollectionValue collectionValue)
Method Detail

createIterators

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

getAccumulatorValue

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


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.


getCollectionValue

public CollectionValue getCollectionValue()

getEvaluationEnvironment

public DomainEvaluationEnvironment getEvaluationEnvironment()

throwInvalidEvaluation

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

toString

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

updateBody

public Value updateBody()
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.