Class ByTypeIndex
java.lang.Object
org.eclipse.emf.compare.match.eobject.internal.ByTypeIndex
- All Implemented Interfaces:
EObjectIndex
,MatchAheadOfTime
An implementation of EObjectIndex which segregates given EObjects using their type and then delegate to
other indexes.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.emf.compare.match.eobject.EObjectIndex
EObjectIndex.Side
-
Constructor Summary
ConstructorDescriptionByTypeIndex
(ProximityEObjectMatcher.DistanceFunction meter, ScopeQuery scope) Create a new instance using the givenProximityEObjectMatcher.DistanceFunction
to instantiate delegate indexes on demand. -
Method Summary
Modifier and TypeMethodDescriptionfindClosests
(Comparison inProgress, EObject obj, EObjectIndex.Side side) Return the closest EObjects found in other sides than the one given.return the list of EObjects of a given side still available in the index.Return EObjects to match ahead of time if there are some.void
index
(EObject eObjs, EObjectIndex.Side side) Register an Object in the index with the given side.void
remove
(EObject obj, EObjectIndex.Side side) Remove an object from the index.
-
Constructor Details
-
ByTypeIndex
Create a new instance using the givenProximityEObjectMatcher.DistanceFunction
to instantiate delegate indexes on demand.- Parameters:
meter
- the function passed when instantiating delegate indexes.scope
- an instance
-
-
Method Details
-
getValuesStillThere
return the list of EObjects of a given side still available in the index.- Specified by:
getValuesStillThere
in interfaceEObjectIndex
- Parameters:
side
- the side we are looking for.- Returns:
- the list of EObjects of a given side still available in the index.
- See Also:
-
findClosests
public Map<EObjectIndex.Side,EObject> findClosests(Comparison inProgress, EObject obj, EObjectIndex.Side side) Return the closest EObjects found in other sides than the one given.- Specified by:
findClosests
in interfaceEObjectIndex
- Parameters:
inProgress
- the comparison currently being computed. It will not be changed directly but only queried to know if some element has already been matched or not.obj
- the base EObject used to lookup similar ones.side
- the side of the passed EObject.- Returns:
- a map of Side, EObjects, returning all the found objects (and the passed one) which are the closests.
- See Also:
-
org.eclipse.emf.compare.match.eobject.EObjectIndex#findClosests(org.eclipse.emf.ecore.EObject, org.eclipse.emf.compare.match.eobject.EObjectIndex.Side, int)
-
remove
Remove an object from the index.- Specified by:
remove
in interfaceEObjectIndex
- Parameters:
obj
- object to remove.side
- Side in which this object was.- See Also:
-
index
Register an Object in the index with the given side.- Specified by:
index
in interfaceEObjectIndex
- Parameters:
eObjs
- theEObject
to register.side
- the side in which it should be registered.- See Also:
-
getValuesToMatchAhead
Return EObjects to match ahead of time if there are some.- Specified by:
getValuesToMatchAhead
in interfaceMatchAheadOfTime
- Parameters:
side
- the side to look for.- Returns:
- the EObjects to match ahead of time.
-