Package org.eclipse.net4j.util.registry

## Class Registry<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>

- 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:
    `DelegatingRegistry`, `HashMapRegistry`

      public abstract class Registry<K,​V>
      extends Container<java.util.Map.Entry<K,​V>>
      implements IRegistry<K,​V>

  Author:
    Eike Stepper

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `protected class` | `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
    Modifier | Constructor | Description
    --- | --- | ---
    `protected` | `Registry()` |
    `protected` | `Registry​(boolean autoCommit)` |

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected void` | `autoCommit()` |
    `void` | `clear()` | Requires `commit()` to be called later if not `isAutoCommit()`.
    `void` | `commit()` |
    `void` | `commit​(boolean notifications)` |
    `boolean` | `containsKey​(java.lang.Object key)` |
    `boolean` | `containsValue​(java.lang.Object value)` |
    `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.Map.Entry<K,​V>[]` | `getElements()` |
    `protected abstract java.util.Map<K,​V>` | `getMap()` |
    `protected Registry.Transaction` | `getTransaction()` |
    `boolean` | `isAutoCommit()` |
    `boolean` | `isEmpty()` |
    `java.util.Set<K>` | `keySet()` |
    `V` | `put​(K key, V value)` | Requires `commit()` to be called later if not `isAutoCommit()`.
    `void` | `putAll​(java.util.Map<? extends K,​? extends V> t)` | Requires `commit()` to be called later if not `isAutoCommit()`.
    `protected V` | `register​(K key, V value)` |
    `V` | `remove​(java.lang.Object key)` | Requires `commit()` to be called later if not `isAutoCommit()`.
    `void` | `setAutoCommit​(boolean autoCommit)` |
    `int` | `size()` |
    `java.lang.String` | `toString()` |
    `java.util.Collection<V>` | `values()` |

    - ### 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

    - #### Registry

          protected Registry​(boolean autoCommit)

    - #### Registry

          protected Registry()

  - ### Method Detail

    - #### isEmpty

          public boolean isEmpty()

      Specified by:
        `isEmpty` in interface `IContainer<K>`
      Specified by:
        `isEmpty` in interface `java.util.Map<K,​V>`
      Overrides:
        `isEmpty` in class `Container<java.util.Map.Entry<K,​V>>`

    - #### size

          public int size()

      Specified by:
        `size` in interface `java.util.Map<K,​V>`

    - #### entrySet

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

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

    - #### keySet

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

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

    - #### values

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

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

    - #### containsKey

          public boolean containsKey​(java.lang.Object key)

      Specified by:
        `containsKey` in interface `java.util.Map<K,​V>`

    - #### containsValue

          public boolean containsValue​(java.lang.Object value)

      Specified by:
        `containsValue` in interface `java.util.Map<K,​V>`

    - #### get

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

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

    - #### put

          public V put​(K key,
                       V value)

      Requires `commit()` to be called later if not `isAutoCommit()`.
      Specified by:
        `put` in interface `java.util.Map<K,​V>`

    - #### putAll

          public void putAll​(java.util.Map<? extends K,​? extends V> t)

      Requires `commit()` to be called later if not `isAutoCommit()`.
      Specified by:
        `putAll` in interface `java.util.Map<K,​V>`

    - #### remove

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

      Requires `commit()` to be called later if not `isAutoCommit()`.
      Specified by:
        `remove` in interface `java.util.Map<K,​V>`

    - #### clear

          public void clear()

      Requires `commit()` to be called later if not `isAutoCommit()`.
      Specified by:
        `clear` in interface `java.util.Map<K,​V>`

    - #### getElements

          public java.util.Map.Entry<K,​V>[] getElements()

      Specified by:
        `getElements` in interface `IContainer<K>`

    - #### isAutoCommit

          public boolean isAutoCommit()

      Specified by:
        `isAutoCommit` in interface `IRegistry<K,​V>`

    - #### setAutoCommit

          public void setAutoCommit​(boolean autoCommit)

      Specified by:
        `setAutoCommit` in interface `IRegistry<K,​V>`

    - #### commit

          public void commit​(boolean notifications)

      Specified by:
        `commit` in interface `IRegistry<K,​V>`

    - #### commit

          public void commit()

      Specified by:
        `commit` in interface `IRegistry<K,​V>`

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `Lifecycle`

    - #### register

          protected V register​(K key,
                               V value)

    - #### deregister

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

    - #### getTransaction

          protected Registry.Transaction getTransaction()

    - #### autoCommit

          protected void autoCommit()

    - #### getMap

          protected abstract java.util.Map<K,​V> getMap()