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  int depth
           
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, Value 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.
 Value get()
          Get the current state of the iterator.
 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, throwInvalidEvaluation, toString, updateBody
 
Methods inherited from class org.eclipse.ocl.examples.domain.library.AbstractIterationManager
getValueFactory, throwInvalidEvaluation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

depth

protected final int depth

referredIterator

protected final DomainTypedElement referredIterator

iterator

protected final EvaluatorIterationManager.ValueIterator iterator
Constructor Detail

EvaluatorSingleIterationManager

public EvaluatorSingleIterationManager(DomainEvaluator invokingEvaluator,
                                       DomainExpression body,
                                       CollectionValue collectionValue,
                                       DomainTypedElement accumulator,
                                       Value accumulatorValue,
                                       DomainTypedElement referredIterator)

EvaluatorSingleIterationManager

protected EvaluatorSingleIterationManager(EvaluatorSingleIterationManager iterationManager,
                                          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

public DomainIterationManager createNestedIterationManager(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

public Value 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

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