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, 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 and Description
    --- | ---
    `protected class` | `Registry.Transaction`

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

      `java.util.Map.Entry<K,V>`

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

  - ### Field Summary

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

      `USE_LABEL`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `Registry()`
    `protected` | `Registry(boolean autoCommit)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and 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, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getListeners, getNotificationService, hasListeners, lastListenerRemoved, removeListener`

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

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

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

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

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

      `addListener, getListeners, hasListeners, removeListener`

- - ### Constructor Detail

    - #### Registry

          protected Registry(boolean autoCommit)

    - #### Registry

          protected Registry()

  - ### Method Detail

    - #### isEmpty

          public boolean isEmpty()

      Specified by:
        `isEmpty` in interface `java.util.Map<K,V>`
      Specified by:
        `isEmpty` in interface `IContainer<java.util.Map.Entry<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<java.util.Map.Entry<K,V>>`

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

Copyright (c) 2014 Eike Stepper (Berlin, Germany) and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html