Class WeightProviderDescriptorRegistryImpl
java.lang.Object
org.eclipse.emf.compare.match.eobject.WeightProviderDescriptorRegistryImpl
- All Implemented Interfaces:
WeightProvider.Descriptor.Registry
public class WeightProviderDescriptorRegistryImpl
extends Object
implements WeightProvider.Descriptor.Registry
This will contain all of the EMF Compare Weight Providers Descriptors.
- Since:
- 3.1.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Removes all extensions from this registry.Returns a registry filled with the default weight providerDefaultWeightProvider
and the ecore weight providerEcoreWeightProvider
provided by EMF Compare.com.google.common.collect.ImmutableList<WeightProvider.Descriptor>
This will return a copy of the registered weight providers list.getHighestRankingWeightProvider
(EPackage ePackage) Retrieve the highest ranking weight provider from a givenePackage
.com.google.common.collect.ImmutableList<WeightProvider>
getWeightProviders
(EPackage ePackage) Retrieve the weight providers from a givenePackage
.put
(String key, WeightProvider.Descriptor weightProvider) Adds a weight provider to the registry.Removes a weight provider from this registry.
-
Constructor Details
-
WeightProviderDescriptorRegistryImpl
public WeightProviderDescriptorRegistryImpl()Creates a new extension registry.
-
-
Method Details
-
createStandaloneInstance
Returns a registry filled with the default weight providerDefaultWeightProvider
and the ecore weight providerEcoreWeightProvider
provided by EMF Compare.- Returns:
- A registry filled with the default & ecore weight providers provided by EMF Compare.
-
put
Adds a weight provider to the registry.- Specified by:
put
in interfaceWeightProvider.Descriptor.Registry
- Parameters:
key
- key with which the specified descriptor is to be associatedweightProvider
- weight provider that is to be added to this registry.- Returns:
- the previous descriptor associated with key, or null if there was no mapping for key. (A null return can also indicate that the map previously associated null with key, if the implementation supports null values.)
-
clear
public void clear()Removes all extensions from this registry.- Specified by:
clear
in interfaceWeightProvider.Descriptor.Registry
-
getDescriptors
This will return a copy of the registered weight providers list.- Specified by:
getDescriptors
in interfaceWeightProvider.Descriptor.Registry
- Returns:
- A copy of the registered weight providers list.
-
remove
Removes a weight provider from this registry.- Specified by:
remove
in interfaceWeightProvider.Descriptor.Registry
- Parameters:
key
- key of the weight provider descriptor that is to be removed from the registry.- Returns:
- the previous value associated with key, or null if there was no mapping for key.
-
getHighestRankingWeightProvider
Retrieve the highest ranking weight provider from a givenePackage
.- Specified by:
getHighestRankingWeightProvider
in interfaceWeightProvider.Descriptor.Registry
- Parameters:
ePackage
- The given ePackage.- Returns:
- The associated weight provider with the highest ranking.
-
getWeightProviders
public com.google.common.collect.ImmutableList<WeightProvider> getWeightProviders(EPackage ePackage) Retrieve the weight providers from a givenePackage
.- Specified by:
getWeightProviders
in interfaceWeightProvider.Descriptor.Registry
- Parameters:
ePackage
- The given ePackage.- Returns:
- The associated weight providers if any.
-