org.eclipse.ocl.examples.impactanalyzer.instanceScope
Class NavigationStepSequence
java.lang.Object
org.eclipse.ocl.examples.impactanalyzer.instanceScope.AbstractNavigationStep
org.eclipse.ocl.examples.impactanalyzer.instanceScope.CompositeNavigationStep
org.eclipse.ocl.examples.impactanalyzer.instanceScope.NavigationStepSequence
- All Implemented Interfaces:
- HashCodeChangeListener, NavigationStep, SemanticComparable
public class NavigationStepSequence
- extends CompositeNavigationStep
Performs a sequence of navigation steps where the subsequent step uses as its input
the output of the previous step. When this navigation reaches an empty set, the result
of the entire navigation step sequence is defined to be empty, even if further navigation
steps follow. The rationale behind this is this: the navigation steps each compute
the set of objects that, when used as context for the root OCL expression, let the
subexpression for which the navigation step is responsible evaluate to a given element.
This means that when a navigation step produces an empty result, then for no element
does the subexpression produce the result sought. Therefore, the further ascend towards
the root expression's context can be aborted at that point.
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, incrementNavigateCounter, isAlwaysEmpty, navigate, newTokenForFiringHashCodeChangeEvent, setAlwaysEmpty, size, toString, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
NavigationStepSequence
public NavigationStepSequence(OCLExpression debugInfo,
NavigationStep... steps)
- Because some
NavigationStep
s such as IndirectingStep
may change
their source/target type as they get lazily initialized, this constructor passes
on null as source/target type. Instead, this class redefined
AbstractNavigationStep.getSourceType()
and AbstractNavigationStep.getTargetType()
and dynamically fetches them
from the underlying step sequence.
isAbsolute
public boolean isAbsolute()
- The sequence is considered absolute if its last step is always empty. This is equivalent to
AbstractNavigationStep.isAlwaysEmpty()
.
- Specified by:
isAbsolute
in interface NavigationStep
- Overrides:
isAbsolute
in class AbstractNavigationStep
- Returns:
- always false
navigate
protected java.util.Set<AnnotatedEObject> navigate(AnnotatedEObject fromObject,
TracebackCache cache,
org.eclipse.emf.common.notify.Notification changeEvent)
- Specified by:
navigate
in class AbstractNavigationStep
contentToString
public java.lang.String contentToString(java.util.Map<NavigationStep,java.lang.Integer> visited,
int indent)
- Overrides:
contentToString
in class AbstractNavigationStep