org.eclipse.ocl.examples.library
Class AbstractIteration<ACC extends Value>
java.lang.Object
org.eclipse.ocl.examples.library.AbstractFeature
org.eclipse.ocl.examples.library.AbstractIteration<ACC>
- All Implemented Interfaces:
- LibraryFeature, LibraryIteration, CallableImplementation
- Direct Known Subclasses:
- AnyIteration, ClosureIteration, CollectIteration, CollectNestedIteration, ExistsIteration, ForAllIteration, IsUniqueIteration, IterateIteration, OneIteration, RejectIteration, SelectIteration, SortedByIteration
public abstract class AbstractIteration<ACC extends Value>
- extends AbstractFeature
- implements LibraryIteration
AbstractIteration realises shared characteristics of library iterations.
- Since:
- 3.1
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractIteration
public AbstractIteration()
createAccumulationValue
protected CollectionValue.Accumulator createAccumulationValue(ValueFactory valueFactory,
boolean isOrdered,
boolean isUnique)
evaluate
public Value evaluate(EvaluationVisitor evaluationVisitor,
Value sourceValue,
CallExp callExp)
- Description copied from interface:
CallableImplementation
-
- Specified by:
evaluate
in interface CallableImplementation
evaluateIteration
protected Value evaluateIteration(IterationManager<ACC> iterationManager)
resolveTerminalValue
protected Value resolveTerminalValue(IterationManager<ACC> iterationManager)
- Return the value appropriate to an iteration over all the source elements. The
default implementation just returns the accumulator. Derived iterations should
override.
- Parameters:
iterationManager
- the iteration context
- Returns:
-
- Throws:
InvalidEvaluationException
updateAccumulator
protected abstract Value updateAccumulator(IterationManager<ACC> iterationManager)
- Update the accumulatorValue with the bodyValue resulting from the current iteration
for which the iterators define the context in the environment.
- Parameters:
iterationManager
- the iteration context
- Returns:
- non-null premature result of iteration, or null if complete
- Throws:
InvalidEvaluationException