org.eclipse.ocl.examples.domain.library
Class EvaluatorSingleIterationManager

java.lang.Object
  extended by org.eclipse.ocl.examples.domain.library.AbstractIterationManager
      extended by org.eclipse.ocl.examples.domain.library.EvaluatorIterationManager
          extended by org.eclipse.ocl.examples.domain.library.EvaluatorSingleIterationManager
All Implemented Interfaces:
DomainIterationManager

public class EvaluatorSingleIterationManager
extends EvaluatorIterationManager


Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.ocl.examples.domain.library.EvaluatorIterationManager
EvaluatorIterationManager.ValueIterator
 
Field Summary
protected  EvaluatorIterationManager.ValueIterator iterator
           
protected  DomainTypedElement referredIterator
           
 
Fields inherited from class org.eclipse.ocl.examples.domain.library.EvaluatorIterationManager
accumulatorVariable, body, collectionValue
 
Fields inherited from class org.eclipse.ocl.examples.domain.library.AbstractIterationManager
evaluator
 
Constructor Summary
  EvaluatorSingleIterationManager(DomainEvaluator invokingEvaluator, DomainExpression body, CollectionValue collectionValue, DomainTypedElement accumulator, java.lang.Object accumulatorValue, DomainTypedElement referredIterator)
           
protected EvaluatorSingleIterationManager(EvaluatorSingleIterationManager iterationManager, CollectionValue value)
           
 
Method Summary
 boolean advanceIterators()
          Advance the iterators to the next iteration, returning false once all possible iterator states have been exhausted.
 DomainIterationManager createNestedIterationManager(CollectionValue value)
          Create a nested iteration supervisor.
 java.lang.Object get()
          Get the current state of the iterator.
 int getDepth()
           
 EvaluatorSingleIterationManager getRootIterationManager()
           
 boolean hasCurrent()
          Return true if the iterators have a step to be evaluated.
 boolean isOuterIteration()
          Get the current iteration depth.
 
Methods inherited from class org.eclipse.ocl.examples.domain.library.EvaluatorIterationManager
createIterators, evaluateBody, getAccumulatorValue, getCollectionValue, getEvaluationEnvironment, getSourceCollection, toString, updateAccumulator
 
Methods inherited from class org.eclipse.ocl.examples.domain.library.AbstractIterationManager
getEvaluator, getStandardLibrary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

referredIterator

@NonNull
protected final DomainTypedElement referredIterator

iterator

@NonNull
protected final EvaluatorIterationManager.ValueIterator iterator
Constructor Detail

EvaluatorSingleIterationManager

public EvaluatorSingleIterationManager(@NonNull
                                       DomainEvaluator invokingEvaluator,
                                       @NonNull
                                       DomainExpression body,
                                       @NonNull
                                       CollectionValue collectionValue,
                                       @Nullable
                                       DomainTypedElement accumulator,
                                       @Nullable
                                       java.lang.Object accumulatorValue,
                                       @NonNull
                                       DomainTypedElement referredIterator)

EvaluatorSingleIterationManager

protected EvaluatorSingleIterationManager(@NonNull
                                          EvaluatorSingleIterationManager iterationManager,
                                          @NonNull
                                          CollectionValue value)
Method Detail

advanceIterators

public boolean advanceIterators()
Description copied from interface: DomainIterationManager
Advance the iterators to the next iteration, returning false once all possible iterator states have been exhausted.


createNestedIterationManager

@NonNull
public DomainIterationManager createNestedIterationManager(@NonNull
                                                                   CollectionValue value)
Description copied from interface: DomainIterationManager
Create a nested iteration supervisor.
This method supports the closure iteration for which there is only a single iterator, and so this method need only be supported by single iterator managers.

Specified by:
createNestedIterationManager in interface DomainIterationManager
Overrides:
createNestedIterationManager in class AbstractIterationManager
Parameters:
value - the nested iteration domain
Returns:
the iteration space

get

@Nullable
public java.lang.Object get()
Description copied from interface: DomainIterationManager
Get the current state of the iterator.
This is only supported for single iterator iterations.

Specified by:
get in interface DomainIterationManager
Overrides:
get in class AbstractIterationManager

getDepth

public int getDepth()

getRootIterationManager

@NonNull
public EvaluatorSingleIterationManager getRootIterationManager()

hasCurrent

public boolean hasCurrent()
Description copied from interface: DomainIterationManager
Return true if the iterators have a step to be evaluated.


isOuterIteration

public boolean isOuterIteration()
Description copied from interface: DomainIterationManager
Get the current iteration depth.
This is only supported for single iterator recursive iterations such as closure.

Specified by:
isOuterIteration in interface DomainIterationManager
Overrides:
isOuterIteration in class AbstractIterationManager