Package org.eclipse.emf.compare.rcp.internal.policy

# Class LoadOnDemandPolicyRegistryImpl

java.lang.Object
org.eclipse.emf.compare.rcp.internal.policy.LoadOnDemandPolicyRegistryImpl

All Implemented Interfaces:
  `ILoadOnDemandPolicy.Registry`

public class LoadOnDemandPolicyRegistryImpl extends Object implements ILoadOnDemandPolicy.Registry
A default implementation that uses a map internally.

## Constructor Summary

Constructors
Constructor
Description
`LoadOnDemandPolicyRegistryImpl()`
Creates a new implementation.

## Method Summary

Modifier and Type
Method
Description
`ILoadOnDemandPolicy`
`addPolicy(ILoadOnDemandPolicy policy)`
Add the given `policy` to this registry.
`void`
`clear()`
Removes all of the registered policies.
`List<ILoadOnDemandPolicy>`
`getPolicies()`
Returns the list of registered policies.
`boolean`
`hasAnyAuthorizingPolicy(URI uri)`
Returns true if at least one of the contained policy is authorizing the given policy to be loaded on demand.
`ILoadOnDemandPolicy`
`removePolicy(String className)`
Removes the policy registered within this registry with the given class name.

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

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

## Constructor Details

### LoadOnDemandPolicyRegistryImpl

public LoadOnDemandPolicyRegistryImpl()
Creates a new implementation.

## Method Details

### hasAnyAuthorizingPolicy

public boolean hasAnyAuthorizingPolicy(URI uri)
Returns true if at least one of the contained policy is authorizing the given policy to be loaded on demand.

Specified by:
  `hasAnyAuthorizingPolicy` in interface `ILoadOnDemandPolicy.Registry`
Parameters:
  `uri` - the URI to be tested.
Returns:
  true if at least one of the contained policy is authorizing the given policy to be loaded on demand.
See Also:
  - `ILoadOnDemandPolicy.Registry.hasAnyAuthorizingPolicy(org.eclipse.emf.common.util.URI)`

### getPolicies

public List<ILoadOnDemandPolicy> getPolicies()
Returns the list of registered policies.

Specified by:
  `getPolicies` in interface `ILoadOnDemandPolicy.Registry`
Returns:
  the list of registered policies.
See Also:
  - `ILoadOnDemandPolicy.Registry.getPolicies()`

### addPolicy

public ILoadOnDemandPolicy addPolicy(ILoadOnDemandPolicy policy)
Add the given `policy` to this registry.

Specified by:
  `addPolicy` in interface `ILoadOnDemandPolicy.Registry`
Parameters:
  `policy` - the policy to be added.
Returns:
  the previous value associated with the class name of the given `policy`.
See Also:
  - `ILoadOnDemandPolicy.Registry.addPolicy(org.eclipse.emf.compare.rcp.policy.ILoadOnDemandPolicy)`

### removePolicy

public ILoadOnDemandPolicy removePolicy(String className)
Removes the policy registered within this registry with the given class name.

Specified by:
  `removePolicy` in interface `ILoadOnDemandPolicy.Registry`
Parameters:
  `className` - the class name of a previously registered policy.
Returns:
  the previously registered policy or null if none was.
See Also:
  - `ILoadOnDemandPolicy.Registry.removePolicy(java.lang.String)`

### clear

public void clear()
Removes all of the registered policies.

Specified by:
  `clear` in interface `ILoadOnDemandPolicy.Registry`
See Also:
  - `ILoadOnDemandPolicy.Registry.clear()`