Package org.eclipse.emf.compare.rcp.internal.extension.impl

## Class ItemRegistry<T>

- java.lang.Object
- - org.eclipse.emf.compare.rcp.internal.extension.impl.ItemRegistry<T>

Type Parameters:
  `T` - one of the item class

All Implemented Interfaces:
  `IItemRegistry<T>`

    public class ItemRegistry<T>
    extends Object
    implements IItemRegistry<T>

Registry holding `IItemDescriptor`.

### Constructor Summary

Constructors
`ItemRegistry()`

### Method Summary

All Methods Instance Methods Concrete Methods
`IItemDescriptor<T>` `add​(IItemDescriptor<T> itemDescriptor)` Add an item descriptor to the registry.
`void` `clear()` Clear the registry.
`IItemDescriptor<T>` `getHighestRankingDescriptor()` Get the descriptor with the highest ranking in the registry.
`IItemDescriptor<T>` `getItemDescriptor​(String qualifiedClassName)` Return the item descriptor.
`List<IItemDescriptor<T>>` `getItemDescriptors()` Get a list of all `IItemDescriptor` from the registry.
`IItemDescriptor<T>` `remove​(String className)` Remove an `IItemDescriptor` using its key.
`int` `size()` Get the size of the registry.

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

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

### Constructor Detail

#### ItemRegistry

    public ItemRegistry()

### Method Detail

#### getHighestRankingDescriptor

    public IItemDescriptor<T> getHighestRankingDescriptor()

Get the descriptor with the highest ranking in the registry.

Specified by:
  `getHighestRankingDescriptor` in interface `IItemRegistry<T>`
Returns:
  `IItemDescriptor` or `null` if none

#### getItemDescriptors

    public List<IItemDescriptor<T>> getItemDescriptors()

Get a list of all `IItemDescriptor` from the registry.

Specified by:
  `getItemDescriptors` in interface `IItemRegistry<T>`
Returns:
  List of `IItemDescriptor`

#### add

    public IItemDescriptor<T> add​(IItemDescriptor<T> itemDescriptor)

Add an item descriptor to the registry.

Specified by:
  `add` in interface `IItemRegistry<T>`
Parameters:
  `itemDescriptor` - The descriptor to add
Returns:
  The previous `IItemDescriptor` if any.

#### remove

    public IItemDescriptor<T> remove​(String className)

Remove an `IItemDescriptor` using its key.

Specified by:
  `remove` in interface `IItemRegistry<T>`
Parameters:
  `className` - Unique identifier of the `IItemDescriptor`
Returns:
  true if an `IItemDescriptor` has been removed

#### clear

    public void clear()

Clear the registry.

Specified by:
  `clear` in interface `IItemRegistry<T>`

#### size

    public int size()

Get the size of the registry.

Specified by:
  `size` in interface `IItemRegistry<T>`
Returns:
  the size of the registry

#### getItemDescriptor

    public IItemDescriptor<T> getItemDescriptor​(String qualifiedClassName)

Return the item descriptor.

Specified by:
  `getItemDescriptor` in interface `IItemRegistry<T>`
Parameters:
  `qualifiedClassName` - Id of the descriptor.
Returns:
  Engine descriptor