org.eclipse.net4j.util.registry
Class DelegatingRegistry<K,V>

java.lang.Object
  extended by org.eclipse.net4j.util.event.Notifier
      extended by org.eclipse.net4j.util.lifecycle.Lifecycle
          extended by org.eclipse.net4j.util.lifecycle.ShareableLifecycle
              extended by org.eclipse.net4j.util.container.Container<Map.Entry<K,V>>
                  extended by org.eclipse.net4j.util.registry.Registry<K,V>
                      extended by org.eclipse.net4j.util.registry.DelegatingRegistry<K,V>
All Implemented Interfaces:
Map<K,V>, IContainer<Map.Entry<K,V>>, INotifier, 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.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.net4j.util.registry.Registry
Registry.Transaction
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Nested classes/interfaces inherited from interface org.eclipse.net4j.util.container.IContainer
IContainer.Modifiable<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
DelegatingRegistry(IRegistry<K,V> delegate)
           
DelegatingRegistry(IRegistry<K,V> delegate, boolean autoCommit)
           
 
Method Summary
protected  V deregister(Object key)
           
 Set<Map.Entry<K,V>> entrySet()
           
 V get(Object key)
           
 Set<K> keySet()
           
protected  Set<Map.Entry<K,V>> mergedEntrySet()
           
protected  Set<K> mergedKeySet()
           
protected  Collection<V> mergedValues()
           
protected  V register(K key, V value)
           
 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, 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
equals, hashCode
 
Methods inherited from interface org.eclipse.net4j.util.event.INotifier
addListener, getListeners, hasListeners, removeListener
 

Constructor Detail

DelegatingRegistry

public DelegatingRegistry(IRegistry<K,V> delegate)

DelegatingRegistry

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

get

public V get(Object key)
Specified by:
get in interface Map<K,V>
Overrides:
get in class Registry<K,V>

entrySet

public Set<Map.Entry<K,V>> entrySet()
Specified by:
entrySet in interface Map<K,V>
Overrides:
entrySet in class Registry<K,V>

keySet

public Set<K> keySet()
Specified by:
keySet in interface Map<K,V>
Overrides:
keySet in class Registry<K,V>

values

public Collection<V> values()
Specified by:
values in interface 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(Object key)
Overrides:
deregister in class Registry<K,V>

mergedEntrySet

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

mergedKeySet

protected Set<K> mergedKeySet()

mergedValues

protected Collection<V> mergedValues()


Copyright (c) 2011, 2012 Eike Stepper (Berlin, Germany) and others.