Class NameSimilarityMatchingStrategy
java.lang.Object
org.eclipse.emf.compare.match.resource.NameSimilarityMatchingStrategy
- All Implemented Interfaces:
IResourceMatchingStrategy
This implementation of a matching strategy will try and determine the resource mappings through the
similarity of their names.
Specifically, this will determine the cartesian product of the resource sets, compute a similarity for every single couple of Resource, then consider that every similarity that is above 80% constitutes a mapping.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected static MatchResource
createMatchResource
(Resource left, Resource right, Resource origin) Creates aMatchResource
instance and sets all three resources of the mapping on it.matchResources
(Iterable<? extends Resource> left, Iterable<? extends Resource> right, Iterable<? extends Resource> origin) This will be called by the resource matcher in order to determine the matching between n resources.
-
Constructor Details
-
NameSimilarityMatchingStrategy
public NameSimilarityMatchingStrategy()
-
-
Method Details
-
matchResources
public List<MatchResource> matchResources(Iterable<? extends Resource> left, Iterable<? extends Resource> right, Iterable<? extends Resource> origin) This will be called by the resource matcher in order to determine the matching between n resources.- Specified by:
matchResources
in interfaceIResourceMatchingStrategy
- Parameters:
left
- Resources we are to match in the left.right
- Resources we are to match in the right.origin
- Resources we are to match in the origin.- Returns:
- The list of mappings this strategy managed to determine.
- See Also:
-
createMatchResource
Creates aMatchResource
instance and sets all three resources of the mapping on it.- Parameters:
left
- The left resource of this mapping.right
- The right resource of this mapping.origin
- The origin resource of this mapping.- Returns:
- The create mapping.
-