org.eclipse.ocl.examples.impactanalyzer.instanceScope
Class IndirectingStep

java.lang.Object
  extended by org.eclipse.ocl.examples.impactanalyzer.instanceScope.AbstractNavigationStep
      extended by org.eclipse.ocl.examples.impactanalyzer.instanceScope.IndirectingStep
All Implemented Interfaces:
HashCodeChangeListener, NavigationStep, SemanticComparable

public class IndirectingStep
extends AbstractNavigationStep
implements HashCodeChangeListener

Steps of this type can be an empty placeholder during the analysis phase and can be filled in later, e.g., pointing to a real NavigationStep. All fields are initialized with null by the constructor. Clients have to ensure that a valid state is achieved before leaving the analysis phase and using this step.

An indirecting step listens for changes of its actual step's hash code. See HashCodeChangeListener. Changes to the actual step's hash code are forwarded to this step's hash code change listeners.


Nested Class Summary
 class IndirectingStep.IndirectingStepSemanticIdentity
           
 
Constructor Summary
IndirectingStep(OCLExpression debugInfo)
           
 
Method Summary
 void afterHashCodeChange(NavigationStep step, int token)
          Called after the step's SemanticIdentity hash code has changed.
 void beforeHashCodeChange(NavigationStep step, int token)
          Invoked before step's SemanticIdentity changes its hash code.
 java.lang.String contentToString(java.util.Map<NavigationStep,java.lang.Integer> visited, int indent)
           
protected  int distinctSize(java.util.Set<SemanticIdentity> visited)
           
 NavigationStep getActualStep()
           
 InstanceScopeAnalysis getInstanceScopeAnalysis()
           
 SemanticIdentity getSemanticIdentity()
           
protected  void incrementNavigateCounter(java.util.Set<AnnotatedEObject> from)
          Overrides incrementNavigateCounter to suppress counting of additional navigate() call in case of a recursion
 boolean isAbsolute()
          By default, navigation steps depend on the object set to which they are applied.
protected  java.util.Set<AnnotatedEObject> navigate(AnnotatedEObject fromObject, TracebackCache cache, org.eclipse.emf.common.notify.Notification changeEvent)
           
 void setActualStep(NavigationStep actualStep)
           
protected  int size(java.util.Set<NavigationStep> visited)
          An indirecting step 1.
 
Methods inherited from class org.eclipse.ocl.examples.impactanalyzer.instanceScope.AbstractNavigationStep
addAlwaysEmptyChangeListener, addEnteringScopes, addExpressionForWhichThisIsNavigationStep, addHashCodeChangeListener, addLeavingScopes, addSourceTypeChangeListener, addTargetTypeChangeListener, annotateEObject, distinctSize, doesSourceTypeMatch, fireAfterHashCodeChange, fireBeforeHashCodeChange, getDebugInfo, getEnteringScopes, getId, getLeavingScopes, getNavigateCounter, getResultObjectsCounter, getSourceType, getTargetType, haveIntersectingSubclassTree, isAlwaysEmpty, navigate, newTokenForFiringHashCodeChangeEvent, setAlwaysEmpty, size, toString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IndirectingStep

public IndirectingStep(OCLExpression debugInfo)
Method Detail

setActualStep

public void setActualStep(NavigationStep actualStep)

getActualStep

public NavigationStep getActualStep()

navigate

protected java.util.Set<AnnotatedEObject> navigate(AnnotatedEObject fromObject,
                                                   TracebackCache cache,
                                                   org.eclipse.emf.common.notify.Notification changeEvent)
Specified by:
navigate in class AbstractNavigationStep

incrementNavigateCounter

protected void incrementNavigateCounter(java.util.Set<AnnotatedEObject> from)
Overrides incrementNavigateCounter to suppress counting of additional navigate() call in case of a recursion

Overrides:
incrementNavigateCounter in class AbstractNavigationStep

isAbsolute

public boolean isAbsolute()
Description copied from class: AbstractNavigationStep
By default, navigation steps depend on the object set to which they are applied.

Specified by:
isAbsolute in interface NavigationStep
Overrides:
isAbsolute in class AbstractNavigationStep
Returns:
always false

contentToString

public java.lang.String contentToString(java.util.Map<NavigationStep,java.lang.Integer> visited,
                                        int indent)
Overrides:
contentToString in class AbstractNavigationStep

size

protected int size(java.util.Set<NavigationStep> visited)
An indirecting step 1.

Overrides:
size in class AbstractNavigationStep

beforeHashCodeChange

public void beforeHashCodeChange(NavigationStep step,
                                 int token)
Description copied from interface: HashCodeChangeListener
Invoked before step's SemanticIdentity changes its hash code. When this method is called for a step, the HashCodeChangeListener.afterHashCodeChange(NavigationStep, int) is guaranteed to be called on the same listener later, immediately after the hash code has changed. Receiving this call gives the receiver the opportunity to remove the step from hashed structures in order to re-insert it later when the hash code has assumed the new value.

Specified by:
beforeHashCodeChange in interface HashCodeChangeListener
token - a token value identifying the root cause of the change by a monotonously-increasing number. This can be used in cyclic NavigationStep graphs to decide that a root cause has already been handled by a listener when it comes by a second time.

afterHashCodeChange

public void afterHashCodeChange(NavigationStep step,
                                int token)
Description copied from interface: HashCodeChangeListener
Called after the step's SemanticIdentity hash code has changed. This gives hash structures the opportunity to enter the step again.

Specified by:
afterHashCodeChange in interface HashCodeChangeListener
token - a token value identifying the root cause of the change by a monotonously-increasing number. This can be used in cyclic NavigationStep graphs to decide that a root cause has already been handled by a listener when it comes by a second time.

distinctSize

protected int distinctSize(java.util.Set<SemanticIdentity> visited)
Overrides:
distinctSize in class AbstractNavigationStep

getSemanticIdentity

public SemanticIdentity getSemanticIdentity()
Specified by:
getSemanticIdentity in interface SemanticComparable
Overrides:
getSemanticIdentity in class AbstractNavigationStep

getInstanceScopeAnalysis

public InstanceScopeAnalysis getInstanceScopeAnalysis()