Package org.eclipse.emf.compare.scope
Class AbstractComparisonScope
- java.lang.Object
-
- org.eclipse.emf.common.notify.impl.AdapterImpl
-
- org.eclipse.emf.compare.scope.AbstractComparisonScope
-
- All Implemented Interfaces:
Adapter,Adapter.Internal,IComparisonScope,IComparisonScope2,IDiagnosable
- Direct Known Subclasses:
EmptyComparisonScope,FilterComparisonScope
public abstract class AbstractComparisonScope extends AdapterImpl implements IComparisonScope2, IDiagnosable
This implementation ofIComparisonScopecan be sub-classed in order to avoid re-implementing some of the methods imposed by this interface.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.emf.common.notify.Adapter
Adapter.Internal
-
-
Field Summary
Fields Modifier and Type Field Description protected Set<URI>allInvolvedResourceURIsThe resources URIs representing the files that have been selected to be in the scope of the comparison.protected DiagnosticdiagnosticThe diagnostic of the notifiers.protected NotifierleftThe left root of this comparison.protected Set<String>nsURIsThe namespace uris detected in the comparison.protected Notifieroriginprotected Set<String>resourceURIsThe resource uris detected in the comparison.protected NotifierrightThe right root of this comparison.-
Fields inherited from class org.eclipse.emf.common.notify.impl.AdapterImpl
target
-
-
Constructor Summary
Constructors Constructor Description AbstractComparisonScope(Notifier left, Notifier right, Notifier origin)This will instantiate a scope with left, right and origin Notifiers defined.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<URI>getAllInvolvedResourceURIs()Returns the URIs of the all files involved in this scope.DiagnosticgetDiagnostic()Return the diagnostic associated with this scope.NotifiergetLeft()This will be used by EMF Compare in order to retrieve the left "root" Notifier of this comparison; i.e the first object to be considered by the match engine, and from which the iteration over children should start.Set<String>getNsURIs()This will be used by EMF Compare in order to retrieve the namespace uris detected in the scope.NotifiergetOrigin()If EMF Compare should consider a Notifier as being the common ancestor of the "left" and "right" objects to compare, it should be returned from here.Set<String>getResourceURIs()This will be used by EMF Compare in order to retrieve the resource uris detected in the scope.NotifiergetRight()This will be used by EMF Compare in order to retrieve the right "root" Notifier of this comparison; i.e the first object to be considered by the match engine, and from which the iteration over children should start.booleanisAdapterForType(Object type)voidsetDiagnostic(Diagnostic diagnostic)Set the diagnostic to be associated with this scope.-
Methods inherited from class org.eclipse.emf.common.notify.impl.AdapterImpl
getTarget, notifyChanged, setTarget, unsetTarget
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.emf.compare.scope.IComparisonScope
getChildren, getCoveredEObjects, getCoveredResources
-
-
-
-
Field Detail
-
left
protected Notifier left
The left root of this comparison.
-
right
protected Notifier right
The right root of this comparison.
-
origin
protected Notifier origin
-
diagnostic
protected Diagnostic diagnostic
The diagnostic of the notifiers.
-
-
Constructor Detail
-
AbstractComparisonScope
public AbstractComparisonScope(Notifier left, Notifier right, Notifier origin)
This will instantiate a scope with left, right and origin Notifiers defined.- Parameters:
left- The left root of this comparison.right- The right root of this comparison.origin- The common ancestor ofleftandright. May benull.
-
-
Method Detail
-
getLeft
public Notifier getLeft()
This will be used by EMF Compare in order to retrieve the left "root" Notifier of this comparison; i.e the first object to be considered by the match engine, and from which the iteration over children should start.- Specified by:
getLeftin interfaceIComparisonScope- Returns:
- The left root of this comparison. May not be
null. - See Also:
IComparisonScope.getLeft()
-
getRight
public Notifier getRight()
This will be used by EMF Compare in order to retrieve the right "root" Notifier of this comparison; i.e the first object to be considered by the match engine, and from which the iteration over children should start.- Specified by:
getRightin interfaceIComparisonScope- Returns:
- The right root of this comparison. May not be
null. - See Also:
IComparisonScope.getRight()
-
getOrigin
public Notifier getOrigin()
If EMF Compare should consider a Notifier as being the common ancestor of the "left" and "right" objects to compare, it should be returned from here.- Specified by:
getOriginin interfaceIComparisonScope- Returns:
- The origin root for this comparison. May be
null. - See Also:
IComparisonScope.getOrigin()
-
getNsURIs
public Set<String> getNsURIs()
This will be used by EMF Compare in order to retrieve the namespace uris detected in the scope.- Specified by:
getNsURIsin interfaceIComparisonScope- Returns:
- The namespace uris.
- See Also:
IComparisonScope.getNsURIs()
-
getResourceURIs
public Set<String> getResourceURIs()
This will be used by EMF Compare in order to retrieve the resource uris detected in the scope.- Specified by:
getResourceURIsin interfaceIComparisonScope- Returns:
- The resource uris.
- See Also:
IComparisonScope.getResourceURIs()
-
getDiagnostic
public Diagnostic getDiagnostic()
Return the diagnostic associated with this scope. For instance, it may contain errors that occurred during loading of its notifiers.- Specified by:
getDiagnosticin interfaceIDiagnosable- Returns:
- the diagnostic
- See Also:
org.eclipse.emf.compare.scope.IComparisonScope.Internal#getDiagnostic()
-
setDiagnostic
public void setDiagnostic(Diagnostic diagnostic)
Set the diagnostic to be associated with this scope.- Specified by:
setDiagnosticin interfaceIDiagnosable- Parameters:
diagnostic- the diagnostic- See Also:
org.eclipse.emf.compare.scope.IComparisonScope.Internal#setDiagnostic(org.eclipse.emf.common.util.Diagnostic)
-
getAllInvolvedResourceURIs
public Set<URI> getAllInvolvedResourceURIs()
Returns the URIs of the all files involved in this scope.The returned URIs represent all files that have been selected to be in scope of the comparison. This may include files that are not existing anymore or that may have actually not been modified.
- Specified by:
getAllInvolvedResourceURIsin interfaceIComparisonScope2- Returns:
- The file URIs.
- See Also:
IComparisonScope2.getAllInvolvedResourceURIs()
-
isAdapterForType
public boolean isAdapterForType(Object type)
- Specified by:
isAdapterForTypein interfaceAdapter- Overrides:
isAdapterForTypein classAdapterImpl
-
-