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

java.lang.Object
  extended by org.eclipse.net4j.util.registry.UnmodifiableRegistry<K,V>
All Implemented Interfaces:
Map<K,V>, IContainer<Map.Entry<K,V>>, INotifier, IRegistry<K,V>

public class UnmodifiableRegistry<K,V>
extends Object
implements IRegistry<K,V>


Nested Class Summary
 
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>
 
Constructor Summary
UnmodifiableRegistry(IRegistry<K,V> delegate)
           
 
Method Summary
 void addListener(IListener listener)
          Adds a listener to this notifier.
 void clear()
           
 void commit()
           
 void commit(boolean notifications)
           
 boolean containsKey(Object key)
           
 boolean containsValue(Object value)
           
 Set<Map.Entry<K,V>> entrySet()
           
 boolean equals(Object o)
           
 V get(Object key)
           
 Map.Entry<K,V>[] getElements()
           
 IListener[] getListeners()
          Returns the listeners that are registered with this notifier.
 int hashCode()
           
 boolean hasListeners()
          Returns true if one or more listeners are registered with this notifier, false otherwise.
 boolean isAutoCommit()
           
 boolean isEmpty()
           
 Set<K> keySet()
           
 V put(K key, V value)
           
 void putAll(Map<? extends K,? extends V> t)
           
 V remove(Object key)
           
 void removeListener(IListener listener)
          Removes a listener from this notifier.
 void setAutoCommit(boolean on)
           
 int size()
           
 Collection<V> values()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnmodifiableRegistry

public UnmodifiableRegistry(IRegistry<K,V> delegate)
Method Detail

addListener

public void addListener(IListener listener)
Description copied from interface: INotifier
Adds a listener to this notifier.

Depending on the implementation duplicate listeners may lead to duplicate event delivery or not. Implementors are encouraged to prevent events from being delivered more than once to the same listener,

Specified by:
addListener in interface INotifier

removeListener

public void removeListener(IListener listener)
Description copied from interface: INotifier
Removes a listener from this notifier.

Specified by:
removeListener in interface INotifier

getListeners

public IListener[] getListeners()
Description copied from interface: INotifier
Returns the listeners that are registered with this notifier.

Depending on the implementation duplicate listeners may be contained in the returned array.

Specified by:
getListeners in interface INotifier
Since:
3.0

hasListeners

public boolean hasListeners()
Description copied from interface: INotifier
Returns true if one or more listeners are registered with this notifier, false otherwise.

Specified by:
hasListeners in interface INotifier
Since:
3.0

put

public V put(K key,
             V value)
Specified by:
put in interface Map<K,V>

putAll

public void putAll(Map<? extends K,? extends V> t)
Specified by:
putAll in interface Map<K,V>

remove

public V remove(Object key)
Specified by:
remove in interface Map<K,V>

clear

public void clear()
Specified by:
clear in interface Map<K,V>

commit

public void commit()
Specified by:
commit in interface IRegistry<K,V>

commit

public void commit(boolean notifications)
Specified by:
commit in interface IRegistry<K,V>

setAutoCommit

public void setAutoCommit(boolean on)
Specified by:
setAutoCommit in interface IRegistry<K,V>

isAutoCommit

public boolean isAutoCommit()
Specified by:
isAutoCommit in interface IRegistry<K,V>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Map<K,V>
Specified by:
isEmpty in interface IContainer<Map.Entry<K,V>>

size

public int size()
Specified by:
size in interface Map<K,V>

getElements

public Map.Entry<K,V>[] getElements()
Specified by:
getElements in interface IContainer<Map.Entry<K,V>>

get

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

containsKey

public boolean containsKey(Object key)
Specified by:
containsKey in interface Map<K,V>

containsValue

public boolean containsValue(Object value)
Specified by:
containsValue in interface Map<K,V>

entrySet

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

keySet

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

values

public Collection<V> values()
Specified by:
values in interface Map<K,V>

equals

public boolean equals(Object o)
Specified by:
equals in interface Map<K,V>
Overrides:
equals in class Object

hashCode

public int hashCode()
Specified by:
hashCode in interface Map<K,V>
Overrides:
hashCode in class Object


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