org.eclipse.ocl.examples.library.iterator
Class ClosureIteration

java.lang.Object
  extended by org.eclipse.ocl.examples.domain.library.AbstractFeature
      extended by org.eclipse.ocl.examples.domain.library.AbstractIteration
          extended by org.eclipse.ocl.examples.library.iterator.ClosureIteration
All Implemented Interfaces:
LibraryFeature, LibraryIteration

public class ClosureIteration
extends AbstractIteration

ClosureIteration realizes the Collection::closure() library iteration.


Field Summary
static ClosureIteration INSTANCE
           
 
Constructor Summary
ClosureIteration()
           
 
Method Summary
 CollectionValue.Accumulator createAccumulatorValue(DomainEvaluator evaluator, DomainType accumulatorType, DomainType bodyType)
          Create the value that will accumulate the iteration results.
 LibraryValidator getValidator(DomainStandardLibrary standardLibrary)
          Return a validator for a CallExp using this feature.
protected  Value updateAccumulator(DomainIterationManager iterationManager)
          Recursively evaluates the iterator body expression.
 
Methods inherited from class org.eclipse.ocl.examples.domain.library.AbstractIteration
evaluateIteration, resolveTerminalValue
 
Methods inherited from class org.eclipse.ocl.examples.domain.library.AbstractFeature
getLibraryValidator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final ClosureIteration INSTANCE
Constructor Detail

ClosureIteration

public ClosureIteration()
Method Detail

createAccumulatorValue

public CollectionValue.Accumulator createAccumulatorValue(DomainEvaluator evaluator,
                                                          DomainType accumulatorType,
                                                          DomainType bodyType)
Description copied from interface: LibraryIteration
Create the value that will accumulate the iteration results.

Parameters:
evaluator - that supervises evaluation
Returns:
the accumulator

getValidator

public LibraryValidator getValidator(DomainStandardLibrary standardLibrary)
Description copied from interface: LibraryFeature
Return a validator for a CallExp using this feature. May return null for no validator. Validation occurs during analysis with the pivot model using facilities that are not needed for evaluation. This method enables a pivot-unaware evaluation plugin to load a validator from a pivot-aware plugin without imposing a pivot dependency.

Specified by:
getValidator in interface LibraryFeature
Overrides:
getValidator in class AbstractFeature
Parameters:
standardLibrary - a context to assist in class loading.
Returns:

updateAccumulator

protected Value updateAccumulator(DomainIterationManager iterationManager)
Recursively evaluates the iterator body expression.

Specified by:
updateAccumulator in class AbstractIteration
Parameters:
iterationManager - the iteration context
Returns:
non-null premature result of iteration, or null if complete