org.eclipse.net4j.util.registry
Class Registry<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.container.Container<java.util.Map.Entry<K,V>>
              extended by 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.Introspection, ILifecycle, ILifecycle.Introspection, 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>


Nested Class Summary
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.event.INotifier
INotifier.Introspection
 
Nested classes/interfaces inherited from interface org.eclipse.net4j.util.lifecycle.ILifecycle
ILifecycle.Introspection
 
Field Summary
 
Fields inherited from class org.eclipse.net4j.util.lifecycle.Lifecycle
USE_LABEL
 
Constructor Summary
protected Registry()
           
protected Registry(boolean autoCommit)
           
 
Method Summary
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, fireElementAddedEvent, fireElementRemovedEvent, newContainerEvent, newContainerEvent
 
Methods inherited from class org.eclipse.net4j.util.lifecycle.Lifecycle
activate, checkActive, checkArg, checkArg, checkInactive, checkNull, checkState, checkState, deactivate, deferredActivate, deferredDeactivate, doActivate, doBeforeActivate, doBeforeDeactivate, doDeactivate, dump, getLifecycleState, isActive, isDeferredActivation, isDeferredDeactivation
 
Methods inherited from class org.eclipse.net4j.util.event.Notifier
addListener, fireEvent, getListeners, hasListeners, 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, 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) 2004 - 2008 Eike Stepper, Germany.
All Rights Reserved.