public class IdenticalResourceMinimizer extends Object implements IModelMinimizer
This default implementation will consider that all files that are binary identical between the two (or three) sides of the comparison can be safely removed from the scope. Likewise, unmatched read-only files will be removed from the scope.
Constructor and Description |
---|
IdenticalResourceMinimizer() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
equals(IStorage left,
IStorage right)
Checks whether the two given (non-
null ) resources are identical. |
protected boolean |
equals(IStorage left,
IStorage right,
IStorage origin)
Checks whether the three given (non-
null ) resources are identical. |
void |
minimize(SynchronizationModel syncModel,
IProgressMonitor monitor)
This will be called to reduce the number of resources in this model's traversals.
|
protected IStorage |
removeLikeNamedStorageFrom(IStorage reference,
Set<IStorage> candidates)
Looks up into the
candidates set for a storage which name matches that of the reference
storage, removing it if there is one. |
public void minimize(SynchronizationModel syncModel, IProgressMonitor monitor)
minimize
in interface IModelMinimizer
monitor
- Monitor on which to report progress to the user.IModelMinimizer.minimize(org.eclipse.emf.compare.ide.ui.logical.SynchronizationModel,
org.eclipse.core.runtime.IProgressMonitor)
protected boolean equals(IStorage left, IStorage right, IStorage origin)
null
) resources are identical. This default
implementation only checks that the three are identical binary-wise.
Identical resources will be filtered out of the comparison scope.
left
- Left of the resources to consider.right
- Right of the resources to consider.origin
- Common ancestor of the left and right resources.true
if the given resources are to be considered identical, false
otherwise.protected boolean equals(IStorage left, IStorage right)
null
) resources are identical. This default
implementation only checks that the two are identical binary-wise.
Identical resources will be filtered out of the comparison scope.
left
- Left of the resources to consider.rightRight
- of the resources to consider.true
if the given resources are to be considered identical, false
otherwise.protected IStorage removeLikeNamedStorageFrom(IStorage reference, Set<IStorage> candidates)
candidates
set for a storage which name matches that of the reference
storage, removing it if there is one.reference
- The storage for which we'll seek a match into candidates
.candidates
- The set of candidates into which to look up for a match to reference
.reference
, if any.
null
if none match.
Copyright (c) 2006, 2014 Obeo and others. All rights reserved.