org.eclipse.ocl.examples.library.iterator
Class AnyIteration
java.lang.Object
org.eclipse.ocl.examples.domain.library.AbstractFeature
org.eclipse.ocl.examples.domain.library.AbstractIteration
org.eclipse.ocl.examples.library.iterator.AnyIteration
- All Implemented Interfaces:
- LibraryFeature, LibraryIteration
public class AnyIteration
- extends AbstractIteration
AnyIteration realizes the Collection::any() library iteration.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
INSTANCE
public static final AnyIteration INSTANCE
AnyIteration
public AnyIteration()
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
resolveTerminalValue
protected Value resolveTerminalValue(DomainIterationManager iterationManager)
- Description copied from class:
AbstractIteration
- Return the final result at the end of an iteration over all the source elements. The
default implementation just returns the accumulator. Derived iterations should
override.
This method is bypassed if the iteration ends prematurely.
- Overrides:
resolveTerminalValue
in class AbstractIteration
- Parameters:
iterationManager
- the iteration context
- Returns:
- the result
updateAccumulator
protected Value updateAccumulator(DomainIterationManager iterationManager)
- Description copied from class:
AbstractIteration
- Update the accumulatorValue with the bodyValue resulting from the current iteration
for which the iterators define the context in the environment.
- Specified by:
updateAccumulator
in class AbstractIteration
- Parameters:
iterationManager
- the iteration context
- Returns:
- non-null premature result of iteration, or null if complete