com.generationjava.patterns.registry
Class NullRegistry

java.lang.Object
  |
  +--com.generationjava.patterns.registry.AbstractRegistry
        |
        +--com.generationjava.patterns.registry.NullRegistry
All Implemented Interfaces:
Null, Registry

public class NullRegistry
extends AbstractRegistry
implements Null

A registry which does nothing.


Field Summary
static NullRegistry NULL_REGISTRY
          Singelton null registry.
 
Constructor Summary
NullRegistry()
           
 
Method Summary
 void clear()
          Clear the registry of values.
 java.lang.Object get(java.lang.Object key)
          Returns null.
 Null getNull()
          Returns null.
 java.util.Iterator keys()
          Get the list of known keys.
 void register(java.lang.Object key, java.lang.Object value)
          Registry an object under a registration key.
 void remove(java.lang.Object key)
          Remove a value from the registry for the specified key.
 void setNull(Null value)
          Set the null value which will be returned when a key is requested and is not in the registry.
 
Methods inherited from class com.generationjava.patterns.registry.AbstractRegistry
getRegistryFactory, setRegistryFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NULL_REGISTRY

public static final NullRegistry NULL_REGISTRY
Singelton null registry.

Constructor Detail

NullRegistry

public NullRegistry()
Method Detail

register

public void register(java.lang.Object key,
                     java.lang.Object value)
Description copied from interface: Registry
Registry an object under a registration key.

Specified by:
register in interface Registry
Parameters:
key - Object registration key
value - Object to register

get

public java.lang.Object get(java.lang.Object key)
Returns null.

Specified by:
get in interface Registry

clear

public void clear()
Description copied from interface: Registry
Clear the registry of values.

Specified by:
clear in interface Registry

remove

public void remove(java.lang.Object key)
Description copied from interface: Registry
Remove a value from the registry for the specified key.

Specified by:
remove in interface Registry

keys

public java.util.Iterator keys()
Description copied from interface: Registry
Get the list of known keys.

Specified by:
keys in interface Registry

setNull

public void setNull(Null value)
Description copied from interface: Registry
Set the null value which will be returned when a key is requested and is not in the registry.

Specified by:
setNull in interface Registry
Overrides:
setNull in class AbstractRegistry

getNull

public Null getNull()
Returns null.

Specified by:
getNull in interface Registry
Overrides:
getNull in class AbstractRegistry


Copyright © 2000-2003 GenerationJava. All Rights Reserved.