Package org.eclipse.net4j.util.registry
Class UnmodifiableRegistry<K,V>
- java.lang.Object
-
- org.eclipse.net4j.util.registry.UnmodifiableRegistry<K,V>
-
- All Implemented Interfaces:
java.util.Map<K,V>
,IContainer<java.util.Map.Entry<K,V>>
,INotifier
,IRegistry<K,V>
public class UnmodifiableRegistry<K,V> extends java.lang.Object implements IRegistry<K,V>
-
-
Nested Class Summary
-
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.event.INotifier
INotifier.INotifier2
-
-
Constructor Summary
Constructors Constructor Description UnmodifiableRegistry(IRegistry<K,V> delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addListener(IListener listener)
Adds a listener to this notifier.void
clear()
void
commit()
void
commit(boolean notifications)
boolean
containsKey(java.lang.Object key)
boolean
containsValue(java.lang.Object value)
java.util.Set<java.util.Map.Entry<K,V>>
entrySet()
boolean
equals(java.lang.Object o)
V
get(java.lang.Object key)
java.util.Map.Entry<K,V>[]
getElements()
IListener[]
getListeners()
Returns the listeners that are registered with this notifier.int
hashCode()
boolean
hasListeners()
Returnstrue
if one or more listeners are registered with this notifier,false
otherwise.boolean
isAutoCommit()
boolean
isEmpty()
java.util.Set<K>
keySet()
V
put(K key, V value)
void
putAll(java.util.Map<? extends K,? extends V> t)
V
remove(java.lang.Object key)
void
removeListener(IListener listener)
Removes a listener from this notifier.void
setAutoCommit(boolean on)
int
size()
java.util.Collection<V>
values()
-
-
-
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 interfaceINotifier
-
removeListener
public void removeListener(IListener listener)
Description copied from interface:INotifier
Removes a listener from this notifier.- Specified by:
removeListener
in interfaceINotifier
-
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 interfaceINotifier
- Since:
- 3.0
-
hasListeners
public boolean hasListeners()
Description copied from interface:INotifier
Returnstrue
if one or more listeners are registered with this notifier,false
otherwise.- Specified by:
hasListeners
in interfaceINotifier
- Since:
- 3.0
-
setAutoCommit
public void setAutoCommit(boolean on)
- Specified by:
setAutoCommit
in interfaceIRegistry<K,V>
-
isAutoCommit
public boolean isAutoCommit()
- Specified by:
isAutoCommit
in interfaceIRegistry<K,V>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfaceIContainer<K>
- Specified by:
isEmpty
in interfacejava.util.Map<K,V>
-
getElements
public java.util.Map.Entry<K,V>[] getElements()
- Specified by:
getElements
in interfaceIContainer<K>
-
containsKey
public boolean containsKey(java.lang.Object key)
-
containsValue
public boolean containsValue(java.lang.Object value)
-
values
public java.util.Collection<V> values()
-
equals
public boolean equals(java.lang.Object o)
-
-