Package org.eclipse.emf.compare.match.eobject

# 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

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 provider `DefaultWeightProvider` and the ecore weight provider `EcoreWeightProvider` 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 given `ePackage`.
`com.google.common.collect.ImmutableList<WeightProvider>`
`getWeightProviders(EPackage ePackage)`
Retrieve the weight providers from a given `ePackage`.
`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.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### WeightProviderDescriptorRegistryImpl

public WeightProviderDescriptorRegistryImpl()
Creates a new extension registry.

## Method Details

### createStandaloneInstance

public static WeightProvider.Descriptor.Registry createStandaloneInstance()
Returns a registry filled with the default weight provider `DefaultWeightProvider` and the ecore weight provider `EcoreWeightProvider` 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 interface `WeightProvider.Descriptor.Registry`
Parameters:
  `key` - key with which the specified descriptor is to be associated
  `weightProvider` - 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 interface `WeightProvider.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 interface `WeightProvider.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 interface `WeightProvider.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 given `ePackage`.

Specified by:
  `getHighestRankingWeightProvider` in interface `WeightProvider.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 given `ePackage`.

Specified by:
  `getWeightProviders` in interface `WeightProvider.Descriptor.Registry`
Parameters:
  `ePackage` - The given ePackage.
Returns:
  The associated weight providers if any.