Package org.webharvest
Class AbstractRegistry<K,V>
- java.lang.Object
-
- org.webharvest.AbstractRegistry<K,V>
-
- All Implemented Interfaces:
Registry<K,V>
- Direct Known Subclasses:
ElementsRegistryImpl
public abstract class AbstractRegistry<K,V> extends Object implements Registry<K,V>
Abstract class implementingRegistry
interface. In most cases, in order to introduceRegistry
implementation it is enough to inherit from this class.- Since:
- 2.1.0-SNAPSHOT
- Version:
- %I%, %G%
- Author:
- Piotr Dyraga
- See Also:
Registry
-
-
Constructor Summary
Constructors Constructor Description AbstractRegistry()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
bind(K name, V value)
Binds value under the given name.Set<K>
listBound()
Lists names of all values bound.V
lookup(K name)
Lookups value bound under the given name.void
unbind(K name)
Unbinds name and the associated value from the registry.
-
-
-
Method Detail
-
lookup
public V lookup(K name)
Lookups value bound under the given name. If no value is bound, thennull
is returned.
-
bind
public void bind(K name, V value) throws AlreadyBoundException
Binds value under the given name.- Specified by:
bind
in interfaceRegistry<K,V>
- Parameters:
name
- name under which value is going to be boundvalue
- bound value- Throws:
AlreadyBoundException
- thrown if the given name is already bound to some value
-
unbind
public void unbind(K name)
Unbinds name and the associated value from the registry.
-
-