Package org.eclipse.emf.compare.scope

## Interface IComparisonScope

All Known Subinterfaces:
  `IComparisonScope2`

All Known Implementing Classes:
  `AbstractComparisonScope`, `DefaultComparisonScope`, `EmptyComparisonScope`, `FilterComparisonScope`

    public interface IComparisonScope

This class defines the expected contract of EMF Compare scopes.

The scope will be called on all three root Notifiers in order to determine the range of a given comparison; only those Notifiers will be matched by EMF Compare.

An implementation using Predicates to filter out the children lists can be sub-classed instead, see `FilterComparisonScope`.

See Also:
  `AbstractComparisonScope`, `FilterComparisonScope`

### Method Summary

All Methods Instance Methods Abstract Methods
`Iterator<? extends EObject>` `getChildren​(EObject eObject)` This will be used by EMF Compare in order to know which EObjects should be considered to be part of the comparison scope when it is launched on the given EObject.
`Iterator<? extends EObject>` `getCoveredEObjects​(Resource resource)` This will be used by EMF Compare in order to determine the EObjects that it should iterate over.
`Iterator<? extends Resource>` `getCoveredResources​(ResourceSet resourceSet)` This will be used by EMF Compare in order to determine the Resources that should be considered part of the comparison when it is launched on the given resource set.
`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.
`Set<String>` `getNsURIs()` This will be used by EMF Compare in order to retrieve the namespace uris detected in the scope.
`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.
`Set<String>` `getResourceURIs()` This will be used by EMF Compare in order to retrieve the resource uris detected in the scope.
`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.

### Method Detail

#### getLeft

    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.

Returns:
  The left root of this comparison. May not be `null`.

#### getRight

    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.

Returns:
  The right root of this comparison. May not be `null`.

#### getOrigin

    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.

Returns:
  The origin root for this comparison. May be `null`.

#### getCoveredResources

    Iterator<? extends Resource> getCoveredResources​(ResourceSet resourceSet)

This will be used by EMF Compare in order to determine the Resources that should be considered part of the comparison when it is launched on the given resource set.

Do note that this will only be called once per Resource. We will retrieve the set of EMF resources to include in the comparison, match them, then use `getCoveredEObjects(Resource)` in order to determine the actual EObjects to cover during that comparison.

Parameters:
  `resourceSet` - The resource set for which we need to know all resources spanned by the comparison.
Returns:
  An iterator over the `Resource`s which are part of this scope.

#### getCoveredEObjects

    Iterator<? extends EObject> getCoveredEObjects​(Resource resource)

This will be used by EMF Compare in order to determine the EObjects that it should iterate over.

Do note that this will only be called once per comparison. EMF Compare expects this to return the whole set of EObjects that should be covered by the comparison when launched on the given Resource.

Parameters:
  `resource` - The resource for which we need to determine all EObjects spanned by the comparison.
Returns:
  An iterator over the `EObject`s which are part of this scope.

#### getChildren

    Iterator<? extends EObject> getChildren​(EObject eObject)

This will be used by EMF Compare in order to know which EObjects should be considered to be part of the comparison scope when it is launched on the given EObject.

Do note that this will only be called once per comparison on EObjects, and never for comparisons launched on `ResourceSet`s or `Resource`s. EMF Compare expects the whole set of EObject that should be covered by the comparison to be returned by this.

Parameters:
  `eObject` - The EObject for which we need to determine the comparison scope.
Returns:
  An iterator over the `EObject`s which are part of this scope.

#### getNsURIs

    Set<String> getNsURIs()

This will be used by EMF Compare in order to retrieve the namespace uris detected in the scope.

Returns:
  The namespace uris.

#### getResourceURIs

    Set<String> getResourceURIs()

This will be used by EMF Compare in order to retrieve the resource uris detected in the scope.

Returns:
  The resource uris.