org.eclipse.ocl.examples.library.iterator
Class ClosureIteration
java.lang.Object
org.eclipse.ocl.examples.library.AbstractFeature
org.eclipse.ocl.examples.library.AbstractIteration<CollectionValue.Accumulator>
org.eclipse.ocl.examples.library.iterator.ClosureIteration
- All Implemented Interfaces:
- LibraryFeature, LibraryIteration, CallableImplementation
public class ClosureIteration
- extends AbstractIteration<CollectionValue.Accumulator>
ClosureIteration realizes the Collection::closure() library iteration.
- Since:
- 3.1
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
INSTANCE
public static final ClosureIteration INSTANCE
ClosureIteration
public ClosureIteration()
evaluate
public Value evaluate(EvaluationVisitor evaluationVisitor,
CollectionValue sourceVal,
LoopExp iteratorExp)
- Description copied from interface:
LibraryIteration
- Return the result of evaluating iterationCall upon sourceVal within the environment
provided by EvaluationVisitor. An invalid return may be indicated by throwing an exception
returning Java null or OCL invalid.
- Parameters:
evaluationVisitor
- the evaluation contextsourceVal
- the source operand for the operationiteratorExp
- the iteration and additional arguments
- Returns:
- the evaluated value
updateAccumulator
protected Value updateAccumulator(IterationManager<CollectionValue.Accumulator> iterationManager)
- Recursively evaluates the iterator body expression.
- Specified by:
updateAccumulator
in class AbstractIteration<CollectionValue.Accumulator>
- Parameters:
iterationManager
- the iteration context
- Returns:
- non-null premature result of iteration, or null if complete
validate
public org.eclipse.emf.common.util.Diagnostic validate(TypeManager typeManager,
CallExp callExp)
- Specified by:
validate
in interface CallableImplementation
- Overrides:
validate
in class AbstractFeature