org.eclipse.emf.compare.match.engine
Class GenericMatchScopeProvider

java.lang.Object
  extended by org.eclipse.emf.compare.match.engine.GenericMatchScopeProvider
All Implemented Interfaces:
IMatchScopeProvider

public class GenericMatchScopeProvider
extends java.lang.Object
implements IMatchScopeProvider

The default implementation of an IMatchScopeProvider. It will use GenericMatchScope implementations for all its scopes.

Since:
1.1

Constructor Summary
GenericMatchScopeProvider(org.eclipse.emf.ecore.EObject leftObject, org.eclipse.emf.ecore.EObject rightObject)
          Constructs a left and right GenericMatchScope with the given EObjects.
GenericMatchScopeProvider(org.eclipse.emf.ecore.EObject leftObject, org.eclipse.emf.ecore.EObject rightObject, org.eclipse.emf.ecore.EObject ancestorObject)
          Constructs a left, right, and ancestor GenericMatchScope with the given EObjects.
GenericMatchScopeProvider(org.eclipse.emf.ecore.resource.Resource leftResource, org.eclipse.emf.ecore.resource.Resource rightResource)
          Constructs a left and right GenericMatchScope with the given Resources.
GenericMatchScopeProvider(org.eclipse.emf.ecore.resource.Resource leftResource, org.eclipse.emf.ecore.resource.Resource rightResource, org.eclipse.emf.ecore.resource.Resource ancestorResource)
          Constructs a left, right, and ancestor GenericMatchScope with the given Resources.
GenericMatchScopeProvider(org.eclipse.emf.ecore.resource.ResourceSet leftResourceSet, org.eclipse.emf.ecore.resource.ResourceSet rightResourceSet)
          Constructs a left and right GenericMatchScope with the given ResourceSets.
GenericMatchScopeProvider(org.eclipse.emf.ecore.resource.ResourceSet leftResourceSet, org.eclipse.emf.ecore.resource.ResourceSet rightResourceSet, org.eclipse.emf.ecore.resource.ResourceSet ancestorResourceSet)
          Constructs a left, right, and ancestor GenericMatchScope with the given ResourceSets.
 
Method Summary
 void applyResourceFilter(IResourceFilter filter)
          Allows to apply an IResourceFilter to the contained scopes, to reduce them respectively.
 IMatchScope getAncestorScope()
          The IMatchScope to restrict the ancestor side of comparison.
 IMatchScope getLeftScope()
          The IMatchScope to restrict the left side of comparison.
 IMatchScope getRightScope()
          The IMatchScope to restrict the right side of comparison.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericMatchScopeProvider

public GenericMatchScopeProvider(org.eclipse.emf.ecore.EObject leftObject,
                                 org.eclipse.emf.ecore.EObject rightObject)
Constructs a left and right GenericMatchScope with the given EObjects. No ancestor scope will be created, so calls to getAncestorScope() will return null.

Parameters:
leftObject - the EObject, which will be used to construct the left scope
rightObject - the EObject, which will be used to construct the right scope

GenericMatchScopeProvider

public GenericMatchScopeProvider(org.eclipse.emf.ecore.EObject leftObject,
                                 org.eclipse.emf.ecore.EObject rightObject,
                                 org.eclipse.emf.ecore.EObject ancestorObject)
Constructs a left, right, and ancestor GenericMatchScope with the given EObjects.

Parameters:
leftObject - the EObject, which will be used to construct the left scope
rightObject - the EObject, which will be used to construct the right scope
ancestorObject - the EObject, which will be used to construct the ancestor scope

GenericMatchScopeProvider

public GenericMatchScopeProvider(org.eclipse.emf.ecore.resource.Resource leftResource,
                                 org.eclipse.emf.ecore.resource.Resource rightResource)
Constructs a left and right GenericMatchScope with the given Resources. No ancestor scope will be created, so calls to getAncestorScope() will return null.

Parameters:
leftResource - the Resource, which will be used to construct the left scope
rightResource - the Resource, which will be used to construct the right scope

GenericMatchScopeProvider

public GenericMatchScopeProvider(org.eclipse.emf.ecore.resource.Resource leftResource,
                                 org.eclipse.emf.ecore.resource.Resource rightResource,
                                 org.eclipse.emf.ecore.resource.Resource ancestorResource)
Constructs a left, right, and ancestor GenericMatchScope with the given Resources.

Parameters:
leftResource - the Resource, which will be used to construct the left scope
rightResource - the Resource, which will be used to construct the right scope
ancestorResource - the Resource, which will be used to construct the ancestor scope

GenericMatchScopeProvider

public GenericMatchScopeProvider(org.eclipse.emf.ecore.resource.ResourceSet leftResourceSet,
                                 org.eclipse.emf.ecore.resource.ResourceSet rightResourceSet)
Constructs a left and right GenericMatchScope with the given ResourceSets. No ancestor scope will be created, so calls to getAncestorScope() will return null.

Parameters:
leftResourceSet - the ResourceSet, which will be used to construct the left scope
rightResourceSet - the ResourceSet, which will be used to construct the right scope

GenericMatchScopeProvider

public GenericMatchScopeProvider(org.eclipse.emf.ecore.resource.ResourceSet leftResourceSet,
                                 org.eclipse.emf.ecore.resource.ResourceSet rightResourceSet,
                                 org.eclipse.emf.ecore.resource.ResourceSet ancestorResourceSet)
Constructs a left, right, and ancestor GenericMatchScope with the given ResourceSets.

Parameters:
leftResourceSet - the ResourceSet, which will be used to construct the left scope
rightResourceSet - the ResourceSet, which will be used to construct the right scope
ancestorResourceSet - the ResourceSet, which will be used to construct the ancestor scope
Method Detail

getAncestorScope

public IMatchScope getAncestorScope()
The IMatchScope to restrict the ancestor side of comparison.

Specified by:
getAncestorScope in interface IMatchScopeProvider
Returns:
an instance of IMatchScope. May also be null in case it is used in a two-way-comparison scenario.
See Also:
IMatchScopeProvider.getAncestorScope()

getLeftScope

public IMatchScope getLeftScope()
The IMatchScope to restrict the left side of comparison.

Specified by:
getLeftScope in interface IMatchScopeProvider
Returns:
an instance of IMatchScope. May not be null.
See Also:
IMatchScopeProvider.getLeftScope()

getRightScope

public IMatchScope getRightScope()
The IMatchScope to restrict the right side of comparison.

Specified by:
getRightScope in interface IMatchScopeProvider
Returns:
an instance of IMatchScope. May not be null.
See Also:
IMatchScopeProvider.getRightScope()

applyResourceFilter

public void applyResourceFilter(IResourceFilter filter)
Allows to apply an IResourceFilter to the contained scopes, to reduce them respectively. This will only have an effect, if this scope provider was instantiated using either a Resource or a ResourceSet, but not in case an EObject was used.

Specified by:
applyResourceFilter in interface IMatchScopeProvider
Parameters:
filter - the filter to apply to the resources of the left, right and (if provided) ancestor scope.

Copyright 2006 IBM Corporation and others.
All Rights Reserved.