public class ProximityEObjectMatcher extends Object implements IEObjectMatcher, ScopeQuery
Modifier and Type | Class and Description |
---|---|
static interface |
ProximityEObjectMatcher.DistanceFunction
This represent a distance function used by the
ProximityEObjectMatcher to compare EObjects and
retrieve the closest EObject from one side to another. |
Constructor and Description |
---|
ProximityEObjectMatcher(ProximityEObjectMatcher.DistanceFunction meter)
Create the matcher using the given distance function.
|
Modifier and Type | Method and Description |
---|---|
void |
createMatches(Comparison comparison,
Iterator<? extends EObject> leftEObjects,
Iterator<? extends EObject> rightEObjects,
Iterator<? extends EObject> originEObjects,
Monitor monitor)
This will be called by the match engine to determine matches between EObjects.
|
boolean |
isInScope(EObject eContainer)
Check whether the object is in the scope or not.
|
public ProximityEObjectMatcher(ProximityEObjectMatcher.DistanceFunction meter)
meter
- a function to measure the distance between two EObject
s.public void createMatches(Comparison comparison, Iterator<? extends EObject> leftEObjects, Iterator<? extends EObject> rightEObjects, Iterator<? extends EObject> originEObjects, Monitor monitor)
The implementation should update the given comparison object by adding the Matches it detect. These matches should include both matching and unmatchings EObjects (i.e. EObjects that can be matched in all three lists, EObjects that cna be matched in only two of the three lists, and EObjects that can only be found in one of the three.
createMatches
in interface IEObjectMatcher
comparison
- the comparison to update.leftEObjects
- An iterator over the EObjects that could be found in the left side.rightEObjects
- An iterator over the EObjects that could be found in the right side.originEObjects
- And iterator over the EObject that may be considered ancestors of the couples that can be
detected in the left and right sides.monitor
- The monitor to report progress or to check for cancellationpublic boolean isInScope(EObject eContainer)
isInScope
in interface ScopeQuery
eContainer
- any EObject.
Copyright (c) 2006, 2015 Obeo and others. All rights reserved.