org.eclipse.ocl.examples.impactanalyzer.instanceScope
Class IdentityNavigationStep
java.lang.Object
org.eclipse.ocl.examples.impactanalyzer.instanceScope.AbstractNavigationStep
org.eclipse.ocl.examples.impactanalyzer.instanceScope.IdentityNavigationStep
- All Implemented Interfaces:
- NavigationStep, SemanticComparable
public class IdentityNavigationStep
- extends AbstractNavigationStep
Performs a trivial "identity" navigation, returning the fromObject again. This is useful when only the type
checking that is performed by AbstractNavigationStep.navigate(Set, TracebackCache, Notification)
shall be
employed, such as for an oclAsType method call.
When the source and target type have no common elements in the reflexive subclass inheritance trees,
this means that the step will always return an empty set. This property is analyzed during the construction
of this step object and cached in the AbstractNavigationStep.alwaysEmpty
field. If true, this makes this
step absolute
, and AbstractNavigationStep.isAlwaysEmpty()
will return true.
Methods inherited from class org.eclipse.ocl.examples.impactanalyzer.instanceScope.AbstractNavigationStep |
addAlwaysEmptyChangeListener, addEnteringScopes, addExpressionForWhichThisIsNavigationStep, addHashCodeChangeListener, addLeavingScopes, addSourceTypeChangeListener, addTargetTypeChangeListener, annotateEObject, distinctSize, distinctSize, doesSourceTypeMatch, fireAfterHashCodeChange, fireBeforeHashCodeChange, getDebugInfo, getEnteringScopes, getId, getLeavingScopes, getNavigateCounter, getResultObjectsCounter, getSemanticIdentity, getSourceType, getTargetType, haveIntersectingSubclassTree, incrementNavigateCounter, isAlwaysEmpty, navigate, newTokenForFiringHashCodeChangeEvent, setAlwaysEmpty, size, size, toString, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
IdentityNavigationStep
public IdentityNavigationStep(org.eclipse.emf.ecore.EClass sourceType,
org.eclipse.emf.ecore.EClass targetType,
OCLExpression oclExpression)
navigate
protected java.util.Set<AnnotatedEObject> navigate(AnnotatedEObject fromObject,
TracebackCache cache,
org.eclipse.emf.common.notify.Notification changeEvent)
- Specified by:
navigate
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