Package org.eclipse.net4j.util.registry

## Class DelegatingRegistry<K,​V>

- java.lang.Object
- - org.eclipse.net4j.util.event.Notifier
  - - org.eclipse.net4j.util.lifecycle.Lifecycle
    - - org.eclipse.net4j.util.lifecycle.ShareableLifecycle
      - - org.eclipse.net4j.util.container.Container<java.util.Map.Entry<K,​V>>
        - - org.eclipse.net4j.util.registry.Registry<K,​V>
          - - org.eclipse.net4j.util.registry.DelegatingRegistry<K,​V>

- All Implemented Interfaces:
    `java.util.Map<K,​V>`, `IContainer<java.util.Map.Entry<K,​V>>`, `INotifier`, `INotifier.INotifier2`, `IDeactivateable`, `ILifecycle`, `ILifecycle.DeferrableActivation`, `IRegistry<K,​V>`
  Direct Known Subclasses:
    `HashMapDelegatingRegistry`

      public abstract class DelegatingRegistry<K,​V>
      extends Registry<K,​V>

  Implementation note: AbstractDelegatingRegistry does not preserve the "modifyable view" contract of `Map.entrySet()` as well as of `Map.keySet()`, i.e. they are disconnected sets and modifications applied to them are not applied to their underlying AbstractDelegatingRegistry.

  Author:
    Eike Stepper

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.eclipse.net4j.util.registry.Registry

      `Registry.Transaction`

    - ### Nested classes/interfaces inherited from interface org.eclipse.net4j.util.container.IContainer

      `IContainer.Modifiable<E>, IContainer.Persistable<E>, IContainer.Persistence<E>`

    - ### Nested classes/interfaces inherited from interface org.eclipse.net4j.util.lifecycle.ILifecycle

      `ILifecycle.DeferrableActivation`

    - ### Nested classes/interfaces inherited from interface org.eclipse.net4j.util.event.INotifier

      `INotifier.INotifier2`

    - ### Nested classes/interfaces inherited from interface java.util.Map

      `java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>`

  - ### Field Summary

    - ### Fields inherited from class org.eclipse.net4j.util.lifecycle.Lifecycle

      `USE_LABEL`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `DelegatingRegistry​(IRegistry<K,​V> delegate)` |
    `DelegatingRegistry​(IRegistry<K,​V> delegate, boolean autoCommit)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected V` | `deregister​(java.lang.Object key)` |
    `java.util.Set<java.util.Map.Entry<K,​V>>` | `entrySet()` |
    `V` | `get​(java.lang.Object key)` |
    `java.util.Set<K>` | `keySet()` |
    `protected java.util.Set<java.util.Map.Entry<K,​V>>` | `mergedEntrySet()` |
    `protected java.util.Set<K>` | `mergedKeySet()` |
    `protected java.util.Collection<V>` | `mergedValues()` |
    `protected V` | `register​(K key, V value)` |
    `java.util.Collection<V>` | `values()` |

    - ### Methods inherited from class org.eclipse.net4j.util.registry.Registry

      `autoCommit, clear, commit, commit, containsKey, containsValue, getElements, getMap, getTransaction, isAutoCommit, isEmpty, put, putAll, remove, setAutoCommit, size, toString`

    - ### Methods inherited from class org.eclipse.net4j.util.container.Container

      `fireContainerEvent, fireContainerEvent, fireContainerEvent, fireElementAddedEvent, fireElementRemovedEvent, fireElementsAddedEvent, fireElementsRemovedEvent, fireEvent, newContainerEvent, newContainerEvent`

    - ### Methods inherited from class org.eclipse.net4j.util.lifecycle.Lifecycle

      `activate, checkActive, checkArg, checkArg, checkInactive, checkNull, checkState, checkState, deactivate, deferredActivate, doActivate, doAfterActivate, doBeforeActivate, doBeforeDeactivate, doDeactivate, dump, getLifecycleState, isActive, isDeferredActivation`

    - ### Methods inherited from class org.eclipse.net4j.util.event.Notifier

      `addListener, addUniqueListener, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getListeners, getNotificationService, hasListener, hasListeners, lastListenerRemoved, listenerAdded, listenerRemoved, removeListener`

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

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

    - ### Methods inherited from interface org.eclipse.net4j.util.event.INotifier

      `addListener, getListeners, hasListeners, removeListener`

    - ### Methods inherited from interface java.util.Map

      `compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll`

- - ### Constructor Detail

    - #### DelegatingRegistry

          public DelegatingRegistry​(IRegistry<K,​V> delegate)

    - #### DelegatingRegistry

          public DelegatingRegistry​(IRegistry<K,​V> delegate,
                                    boolean autoCommit)

  - ### Method Detail

    - #### get

          public V get​(java.lang.Object key)

      Specified by:
        `get` in interface `java.util.Map<K,​V>`
      Overrides:
        `get` in class `Registry<K,​V>`

    - #### entrySet

          public java.util.Set<java.util.Map.Entry<K,​V>> entrySet()

      Specified by:
        `entrySet` in interface `java.util.Map<K,​V>`
      Overrides:
        `entrySet` in class `Registry<K,​V>`

    - #### keySet

          public java.util.Set<K> keySet()

      Specified by:
        `keySet` in interface `java.util.Map<K,​V>`
      Overrides:
        `keySet` in class `Registry<K,​V>`

    - #### values

          public java.util.Collection<V> values()

      Specified by:
        `values` in interface `java.util.Map<K,​V>`
      Overrides:
        `values` in class `Registry<K,​V>`

    - #### register

          protected V register​(K key,
                               V value)

      Overrides:
        `register` in class `Registry<K,​V>`

    - #### deregister

          protected V deregister​(java.lang.Object key)

      Overrides:
        `deregister` in class `Registry<K,​V>`

    - #### mergedEntrySet

          protected java.util.Set<java.util.Map.Entry<K,​V>> mergedEntrySet()

    - #### mergedKeySet

          protected java.util.Set<K> mergedKeySet()

    - #### mergedValues

          protected java.util.Collection<V> mergedValues()