org.eclipse.ocl.examples.library
Class IterationManager<ACC extends Value>

java.lang.Object
  extended by org.eclipse.ocl.examples.library.IterationManager<ACC>

public class IterationManager<ACC extends Value>
extends java.lang.Object


Constructor Summary
IterationManager(EvaluationVisitor evaluationVisitor, LoopExp iteratorExp, CollectionValue collectionValue, ACC accumulatorValue)
           
IterationManager(IterationManager<ACC> iterationManager, Value value)
           
 
Method Summary
 void advance()
           
 Value get(int i)
           
 ACC getAccumulatorValue()
           
 Value getBodyValue()
           
 CollectionValue getCollectionValue()
           
 EvaluationEnvironment getEvaluationEnvironment()
           
 Value getFalse()
           
 Value getTrue()
           
 ValueFactory getValueFactory()
           
 boolean hasCurrent()
           
 boolean isOuterIteration()
           
 void replaceAccumulator(ACC accumulatorValue)
          Associate a new value with the accumulator.
 NullValue throwInvalidEvaluation(InvalidValueException e)
           
 NullValue throwInvalidEvaluation(java.lang.String message, java.lang.Object... bindings)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IterationManager

public IterationManager(EvaluationVisitor evaluationVisitor,
                        LoopExp iteratorExp,
                        CollectionValue collectionValue,
                        ACC accumulatorValue)

IterationManager

public IterationManager(IterationManager<ACC> iterationManager,
                        Value value)
                 throws InvalidValueException
Throws:
InvalidValueException
Method Detail

advance

public void advance()

get

public Value get(int i)

getAccumulatorValue

public ACC getAccumulatorValue()

getBodyValue

public Value getBodyValue()

getCollectionValue

public CollectionValue getCollectionValue()

getEvaluationEnvironment

public EvaluationEnvironment getEvaluationEnvironment()

getFalse

public Value getFalse()

getTrue

public Value getTrue()

getValueFactory

public ValueFactory getValueFactory()

hasCurrent

public boolean hasCurrent()

isOuterIteration

public boolean isOuterIteration()

replaceAccumulator

public void replaceAccumulator(ACC accumulatorValue)
Associate a new value with the accumulator.

This is only used by an "iterate" where the accumulator takes on arbitrary values. Other iterations have an updating accumulator value.

Parameters:
accumulatorValue -

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

throwInvalidEvaluation

public NullValue throwInvalidEvaluation(java.lang.String message,
                                        java.lang.Object... bindings)
                                 throws InvalidEvaluationException
Throws:
InvalidEvaluationException

throwInvalidEvaluation

public NullValue throwInvalidEvaluation(InvalidValueException e)