public abstract class CompositeNavigationStep extends AbstractNavigationStep implements HashCodeChangeListener
HashCodeChangeListener
on each
contained step and propagate the event correspondingly. The hash code combination for the subordinate
steps, once computed, is cached and updated when subordinate steps send hash code change events.Constructor and Description |
---|
CompositeNavigationStep(org.eclipse.emf.ecore.EClass sourceType,
org.eclipse.emf.ecore.EClass targetType,
OCLExpression debugInfo,
NavigationStep... steps) |
Modifier and Type | Method and Description |
---|---|
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. |
protected int |
distinctSize(java.util.Set<SemanticIdentity> visited) |
InstanceScopeAnalysis |
getInstanceScopeAnalysis() |
SemanticIdentity |
getSemanticIdentity() |
protected SemanticIdentity |
getSemanticIdentityOfAbstractNavigationStep() |
NavigationStep[] |
getSteps() |
protected int |
size(java.util.Set<NavigationStep> visited)
The default size in particular for atomic navigation steps is 1.
|
addAlwaysEmptyChangeListener, addEnteringScopes, addExpressionForWhichThisIsNavigationStep, addHashCodeChangeListener, addLeavingScopes, addSourceTypeChangeListener, addTargetTypeChangeListener, annotateEObject, contentToString, distinctSize, doesSourceTypeMatch, fireAfterHashCodeChange, fireBeforeHashCodeChange, getDebugInfo, getEnteringScopes, getId, getLeavingScopes, getNavigateCounter, getResultObjectsCounter, getSourceType, getTargetType, haveIntersectingSubclassTree, incrementNavigateCounter, isAbsolute, isAlwaysEmpty, navigate, navigate, newTokenForFiringHashCodeChangeEvent, setAlwaysEmpty, size, toString, toString
public CompositeNavigationStep(org.eclipse.emf.ecore.EClass sourceType, org.eclipse.emf.ecore.EClass targetType, OCLExpression debugInfo, NavigationStep... steps)
protected SemanticIdentity getSemanticIdentityOfAbstractNavigationStep()
public NavigationStep[] getSteps()
public void beforeHashCodeChange(NavigationStep step, int token)
HashCodeChangeListener
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.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.public void afterHashCodeChange(NavigationStep step, int token)
HashCodeChangeListener
step
's SemanticIdentity
hash code has changed. This gives hash structures the
opportunity to enter the step again.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.protected int size(java.util.Set<NavigationStep> visited)
size
in class AbstractNavigationStep
protected int distinctSize(java.util.Set<SemanticIdentity> visited)
distinctSize
in class AbstractNavigationStep
public SemanticIdentity getSemanticIdentity()
getSemanticIdentity
in interface SemanticComparable
getSemanticIdentity
in class AbstractNavigationStep
public InstanceScopeAnalysis getInstanceScopeAnalysis()