org.eclipse.ocl.examples.codegen.java.iteration
Class AbstractAccumulation2Java

java.lang.Object
  extended by org.eclipse.ocl.examples.codegen.java.iteration.AbstractIteration2Java
      extended by org.eclipse.ocl.examples.codegen.java.iteration.AbstractAccumulation2Java
All Implemented Interfaces:
IterationHelper, Iteration2Java
Direct Known Subclasses:
CollectIteration2Java, CollectNestedIteration2Java, IsUniqueIteration2Java, IterateIteration2Java, OneIteration2Java, RejectIteration2Java, SelectIteration2Java

public abstract class AbstractAccumulation2Java
extends AbstractIteration2Java


Constructor Summary
AbstractAccumulation2Java()
           
 
Method Summary
 void appendAccumulatorInit(JavaStream js, CGBuiltInIterationCallExp cgIterationCallExp)
           
 boolean appendFinalValue(JavaStream js, CGBuiltInIterationCallExp cgIterationCallExp)
          Append the code to assign the final value to the result.
protected  CGIterator getAccumulator(CGBuiltInIterationCallExp cgIterationCallExp)
           
protected  java.lang.Class<?> getAccumulatorClass(CodeGenAnalyzer analyzer, CollectionTypeId typeId)
           
 CGTypeId getAccumulatorTypeId(CodeGenAnalyzer analyzer, CGBuiltInIterationCallExp cgIterationCallExp)
           
 
Methods inherited from class org.eclipse.ocl.examples.codegen.java.iteration.AbstractIteration2Java
getBody, getIterator
 
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.codegen.java.Iteration2Java
appendUpdate
 

Constructor Detail

AbstractAccumulation2Java

public AbstractAccumulation2Java()
Method Detail

appendAccumulatorInit

public void appendAccumulatorInit(@NonNull
                                  JavaStream js,
                                  @NonNull
                                  CGBuiltInIterationCallExp cgIterationCallExp)
Specified by:
appendAccumulatorInit in interface Iteration2Java
Overrides:
appendAccumulatorInit in class AbstractIteration2Java

appendFinalValue

public boolean appendFinalValue(@NonNull
                                JavaStream js,
                                @NonNull
                                CGBuiltInIterationCallExp cgIterationCallExp)
Description copied from interface: Iteration2Java
Append the code to assign the final value to the result.

Returns true if control flow continues into a break, false if terminated by a throw.


getAccumulator

@NonNull
protected CGIterator getAccumulator(@NonNull
                                            CGBuiltInIterationCallExp cgIterationCallExp)

getAccumulatorClass

@NonNull
protected java.lang.Class<?> getAccumulatorClass(@NonNull
                                                         CodeGenAnalyzer analyzer,
                                                         @NonNull
                                                         CollectionTypeId typeId)

getAccumulatorTypeId

@Nullable
public CGTypeId getAccumulatorTypeId(@NonNull
                                              CodeGenAnalyzer analyzer,
                                              @NonNull
                                              CGBuiltInIterationCallExp cgIterationCallExp)
Specified by:
getAccumulatorTypeId in interface IterationHelper
Overrides:
getAccumulatorTypeId in class AbstractIteration2Java