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
Constructors Constructor Description WeightProviderDescriptorRegistryImpl()
Creates a new extension registry.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Removes all extensions from this registry.static WeightProvider.Descriptor.Registry
createStandaloneInstance()
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>
getDescriptors()
This will return a copy of the registered weight providers list.WeightProvider
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
.WeightProvider.Descriptor
put(String key, WeightProvider.Descriptor weightProvider)
Adds a weight provider to the registry.WeightProvider.Descriptor
remove(String key)
Removes a weight provider from this registry.
-
-
-
Method Detail
-
createStandaloneInstance
public static WeightProvider.Descriptor.Registry 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
public WeightProvider.Descriptor put(String key, WeightProvider.Descriptor weightProvider)
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
public com.google.common.collect.ImmutableList<WeightProvider.Descriptor> 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
public WeightProvider.Descriptor remove(String key)
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
public WeightProvider getHighestRankingWeightProvider(EPackage ePackage)
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.
-
-