org.eclipse.ocl.examples.library.iterator
Class SortedByIteration
java.lang.Object
org.eclipse.ocl.examples.library.AbstractFeature
org.eclipse.ocl.examples.library.AbstractIteration<SortedByIteration.SortingValue>
org.eclipse.ocl.examples.library.iterator.SortedByIteration
- All Implemented Interfaces:
- LibraryFeature, LibraryIteration, CallableImplementation
public class SortedByIteration
- extends AbstractIteration<SortedByIteration.SortingValue>
SelectIteration realises the Collection::sortedBy() 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 SortedByIteration INSTANCE
SortedByIteration
public SortedByIteration()
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
resolveTerminalValue
protected Value resolveTerminalValue(IterationManager<SortedByIteration.SortingValue> iterationManager)
- Description copied from class:
AbstractIteration
- Return the value appropriate to an iteration over all the source elements. The
default implementation just returns the accumulator. Derived iterations should
override.
- Overrides:
resolveTerminalValue
in class AbstractIteration<SortedByIteration.SortingValue>
- Parameters:
iterationManager
- the iteration context
- Returns:
updateAccumulator
protected Value updateAccumulator(IterationManager<SortedByIteration.SortingValue> 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<SortedByIteration.SortingValue>
- 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