|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.ocl.examples.domain.values.util.ValuesUtil org.eclipse.ocl.examples.domain.library.AbstractFeature org.eclipse.ocl.examples.domain.library.AbstractIteration
public abstract class AbstractIteration
AbstractIteration realizes shared characteristics of library iterations by providing a default iteration algorithm with a call-back at each iteration step.
Nested Class Summary | |
---|---|
static class |
AbstractIteration.MutableObject
A MutableObject may be used as an iteration accumulatior containing a single changing value. |
Field Summary | |
---|---|
protected static java.lang.Object |
CARRY_ON
An out-of-band value that can be returned by updateAccumulator(org.eclipse.ocl.examples.domain.evaluation.DomainIterationManager) to signal
that the iteration should carry on rather than terminate using the returned value. |
Fields inherited from class org.eclipse.ocl.examples.domain.values.util.ValuesUtil |
---|
EMPTY_BAG, EMPTY_SET, FALSE_VALUE, INTEGER_MAX_VALUE, INTEGER_MIN_VALUE, INVALID_VALUE, LONG_MAX_VALUE, LONG_MIN_VALUE, NULL_STRING, NULL_VALUE, ONE_VALUE, TRUE_VALUE, UNLIMITED_VALUE, ZERO_VALUE |
Constructor Summary | |
---|---|
AbstractIteration()
|
Method Summary | |
---|---|
java.lang.Object |
evaluateIteration(DomainIterationManager iterationManager)
The default iteration algorithm steps through the iteration domain by invoking DomainIterationManager.hasCurrent() and DomainIterationManager.advanceIterators() . |
protected java.lang.Object |
resolveTerminalValue(DomainIterationManager iterationManager)
Return the final result at the end of an iteration over all the source elements. |
protected abstract java.lang.Object |
updateAccumulator(DomainIterationManager iterationManager)
Update the accumulatorValue with the bodyValue resulting from the current iteration for which the iterators define the context in the environment. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.eclipse.ocl.examples.domain.library.LibraryIteration |
---|
createAccumulatorValue |
Field Detail |
---|
@NonNull protected static final java.lang.Object CARRY_ON
updateAccumulator(org.eclipse.ocl.examples.domain.evaluation.DomainIterationManager)
to signal
that the iteration should carry on rather than terminate using the returned value.
Constructor Detail |
---|
public AbstractIteration()
Method Detail |
---|
@Nullable public java.lang.Object evaluateIteration(@NonNull DomainIterationManager iterationManager)
DomainIterationManager.hasCurrent()
and DomainIterationManager.advanceIterators()
.
At each step updateAccumulator(DomainIterationManager)
is invoked to update the
accumulator for that step. A non-null return causes a premature exit and forms the
return from the overall evaluation. If all steps complete resolveTerminalValue(DomainIterationManager)
is invoked to provide the return value.
Derived classes may override this method to change the iteration algorithm or override the call-backs to customize the default iteration.
evaluateIteration
in interface LibraryIteration
iterationManager
- the iteration space
java.lang.Exception
@Nullable protected java.lang.Object resolveTerminalValue(@NonNull DomainIterationManager iterationManager)
iterationManager
- the iteration context
@Nullable protected abstract java.lang.Object updateAccumulator(@NonNull DomainIterationManager iterationManager)
iterationManager
- the iteration context
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |